This file contains hidden or 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
#Find Distribution Version | |
lsb_release -a | |
This file contains hidden or 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 sys | |
import re | |
from datetime import datetime | |
import time | |
if hasattr(datetime, 'strptime'): | |
#python 2.6 | |
strptime = datetime.strptime |
This file contains hidden or 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/sh | |
rx1=`grep eth0 /proc/net/dev | awk '{print $1}' | sed 's/.*://'` | |
tx1=`grep eth0 /proc/net/dev | awk '{print $9}'` | |
sleep 3 | |
rx2=`grep eth0 /proc/net/dev | awk '{print $1}' | sed 's/.*://'` | |
tx2=`grep eth0 /proc/net/dev | awk '{print $9}'` | |
rx3=$(((rx2-rx1)/3*8/1024/1024)) | |
tx3=$(((tx2-tx1)/3*8/1024/1024)) |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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/sh | |
PIDFILE=/tmp/update_index.pid | |
if [ -e $PIDFILE ] | |
then | |
PID=$(cat $PIDFILE) | |
PSCNT=$(ps -p $PID | grep -v CMD | wc -l) |
This file contains hidden or 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
""" | |
This is clone of requests python package | |
if server is inconvenience to install python package, I want to use this | |
""" | |
import urllib2 | |
import urllib | |
NewerOlder