This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration | |
Edit /etc/sysconfig/vnstat, enter: | |
# vi /etc/sysconfig/vnstat | |
Sample outputs: | |
VNSTAT_OPTIONS="-u -i eth0" | |
Edit /etc/vnstat.conf, enter: | |
# vi /etc/vnstat.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ping -q -i1 -c3 target 2>&1|awk '/unknown host/{system("mailx -s \""$4" DNS resolution failed on `uname -n` at `date`\" [email protected] >/dev/null")} /[:alpha:]/{S=S" "$0} END {print S}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -n "That's the text"|openssl enc -e -aes-256-cbc -a | |
Encrypt with interactive password. Encrypted message is base64-encoded afterwards. | |
echo -n "That's the text"|openssl enc -e -aes-256-cbc -a -k "MySuperPassword" | |
Encrypt with specified password. Encrypted message is base64-encoded afterwards. | |
echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc | |
Base-64 decode and decrypt message with interactive password. | |
echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc -k "MySuperPassword" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmux -- terminal multiplexer | |
Managing tmux sessions: | |
$ tmux # start tmux server | |
$ tmux at # attach running sessions to a terminal | |
$ tmux ls # list running tmux sessions | |
$ exit # close tmux session | |
Sharing sessions between terminals: | |
$ tmux new -s session_name # make new named session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib import urlopen; | |
import json, sys; | |
url = "http://openweathermap.org/data/2.1/find/name?q=" + city; | |
t = json.load(urlopen(url))['list'][0]['main']['temp'] - 273.15; | |
print t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess | |
import sys | |
import time | |
from optparse import OptionParser | |
def getOptionParser(): | |
parser = OptionParser(version = '0.1_2012017', | |
description = '''Script measures IO activity of the processes for a specified amount of time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadModule fastcgi_module modules/mod_fastcgi.so | |
<IfModule mod_fastcgi.c> | |
# URIs that begin with /fcgi-bin/, are found in /var/www/fcgi-bin/ | |
Alias /fcgi-bin/ /var/www/fcgi-bin/ | |
# Anything in here is handled as a "dynamic" server if not defined as "static" or "external" | |
<Directory /var/www/fcgi-bin/> | |
SetHandler fastcgi-script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Ensure the Siebel Server Service and Web Server services are offline | |
2) Run gtwysrvr\siebenv.sh | |
3) Stop the Gateway Server service (stop_ns) | |
4) Copy svc.gtwyns. in $SIEBEL_ROOT/gtwysrvr/sys to backup.svc.gtwyns.old | |
5) Delete the svc.gtwyns. file | |
6) Run the command siebctl -S gtwyns -a -g "/f $SIEBEL_ROOT/sys/siebns.dat /t 2320" substituting the port number for the Gateway Server service in place of 2320. | |
7) Start the Siebel Gateway service (start_ns) | |
8) Type list_ns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/opt/local/bin/curl -v -H 'Content-Type: application/json' -X POST http://echo.httpkit.com -d @- <<'EOF' | |
{"test": 123, "aaa": 333} | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((date; curl -s localhost:7777/server-status|grep '<tr><td>'|sed -r 's/.*<\/b><\/td><td>([0-9]{2,}).*/\1/g'|sort|uniq)|tr '\n' '|'; echo) >> /tmp/apache.pids |
OlderNewer