Quantcast
Channel: Bash – Jackie Chen's IT Workshop
Browsing all 22 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Bash: UT-Citrix

I developed the Ubuntu version Citrix thin client. To follow the same naming convention as TC-Citrix, I name it UT-Citrix. Here are the key scripts: checkip #!/bin/bash #wait for the DHCP ready while !...

View Article



Image may be NSFW.
Clik here to view.

Bash: Log File Archive Script

There are some logs files are in such format: 20120130-174201-130947.log. I created two bash scripts to archive them by year/month/day: The first one is based on the log file creation date, the other...

View Article

Image may be NSFW.
Clik here to view.

Auto Configure Proxy in Ubuntu

It is painful to turn the proxy on and off in my Ubuntu laptop between office and home.  As a lazy guy, I would like to make it automatic. Easy life now 1) Create 3 scripts named proxy_on, proxy_off...

View Article

Image may be NSFW.
Clik here to view.

Fortinet SSL VPN Client in Ubuntu

It is intereting that the Fortinet SSL VPN client works fine in my Windows machine, but does not work in my Ubuntu laptop. I have found the reason is that a few routes are missed in the routing table....

View Article

Image may be NSFW.
Clik here to view.

Auto deploy Puppet Agent

Continue with my previous Puppet and Puppet dashboard installation, now I start to deploy the agent to all my Ubuntu desktops. I wrote a script to do the dirty work.    Pre-requisite package: expect...

View Article


Image may be NSFW.
Clik here to view.

Ubuntu Wallpaper of the Day

My inspiration of the ‘Wallpaper of the Day’ comes from the Nation Geographic Photo of the Day. National Geographic recommends an amazing photo each day on this web site. I wrote a bash script to...

View Article

Image may be NSFW.
Clik here to view.

Bash Special Variables

To better understand the bash special variables, I wrote a script to help myself. #!/bin/bash #Usage of $#echo ————————————————————echo -e You have entered $# arguments. #Usage of $*echo...

View Article

Image may be NSFW.
Clik here to view.

Use svcmon to monitor V7000 SAN

I managed to set up the svcmon to monitor the V7000. Here is my how to: 1) Create passwordless SSH user svcmon Use ssh-keygen to generate a key pair, then create a new user named svcmon (in the admin...

View Article


Image may be NSFW.
Clik here to view.

svcmon web gui

If you have ever used svcmon that you should find that it is not convenient to check the report. Basically, you have to go to the folder to view the graph one by one. What if you want to view …...

View Article


Image may be NSFW.
Clik here to view.

svcmon web gui version 1.1

Continue with my previous svcmon web gui post, I added a small feature to allow users to retrieve the history data in the past X days. Now it looks this: The source codes have been updated and can be...

View Article

Image may be NSFW.
Clik here to view.

Monitor V7000 active alerts in Xymon

  Continue with my previous post on installing the Xymon, you can write your own monitor scripts. I wrote a script named v7000alerts to check whether there are active alerts in my IBM StorWize V7000....

View Article

Image may be NSFW.
Clik here to view.

Monitor IBM BladeCenter system status in Xymon

Similar to the IBM StorWize V7000 SAN Xymon monitoring script, I wrote another script to monitor the IBM BladeCenter system status. The script can be downloaded from here:

View Article

Image may be NSFW.
Clik here to view.

Push public key to remote hosts in a batch

Sometimes it is easy to use the passwordless SSH authentication against the remotes hosts. I wrote a script that can push your public key to remote hosts in a batch. The script can be downloaded from here

View Article


Image may be NSFW.
Clik here to view.

Update puppet tags

This script allow you to apply the specified puppet tags to the listed hosts. It will do a dry run against the first host, if you are happy with the results then you can kick off the changes to all …...

View Article

Image may be NSFW.
Clik here to view.

Use sed to append a file to another

To append file2 to a specific line in file1, here is command: sed -i “<line>r file2″ file1 Example:

View Article


Image may be NSFW.
Clik here to view.

Apache mod_rewrite URL redirect script

I wrote a bash script to automate the Apache (mod_rewrite) URL redirection. It supports 3 types of redirection: - One to One: eg. From http://jackiechen.local/mylab To http://jackiechen.org./mylab -...

View Article

Image may be NSFW.
Clik here to view.

Show public IP in Linux command

In Linux console, run the following command to show the public IP address of the machine. curl echoip.net ; echo

View Article


Image may be NSFW.
Clik here to view.

SELinux block timedatectl changes

Just found out this morning that if SELinux is in enforcing mode, it may block the timedatectl command to run in RHEL7. Once changing SELinux to permissive, the problem is gone. Here is the error that...

View Article

Image may be NSFW.
Clik here to view.

Automate Akamai Cloudlets Edge Redirect

This is one of my side projects. It is written in Python and Bash. The step is very straight forward: Download the current production version -> Add the rules, then pushes it to the staging ->...

View Article

Image may be NSFW.
Clik here to view.

Run query via Sumologic API

SumoLogic query can also be run via API. Here is a bash example that I wrote to get the nginx access logs. By default it searches the logs in the past 10 minutes, but you can overwrite it by adding a...

View Article
Browsing all 22 articles
Browse latest View live




Latest Images