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
def get_file_modified_datetime(filename): | |
return time.ctime(os.stat(filename).st_mtime) |
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 os | |
import stat | |
def a(): | |
"""#! /usr/bin/python |
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
treesize(){ | |
du -k --max-depth=1 | sort -nr | awk ' | |
BEGIN { | |
split("KB,MB,GB,TB", Units, ","); | |
} | |
{ | |
u = 1; | |
while ($1 >= 1024) { | |
$1 = $1 / 1024; | |
u += 1 |
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
# myMAC .bash_profile | |
# a decent bash prompt | |
# \d = date - \t = time - \u = user - \h = host - \w = cwd | |
#PS1='\[\e[1;33m\]\d \[\e[1;34m\]\t \[\e[1;36m\]\u\[\e[1;35m\]@\[\e[1;31m\]\h \[\e[1;33m\](\[\e[1;36m\]\w\[\e[1;33m\]) \[\e[1;37m\]% \e[m' | |
PS1='\[\e[1;35m\][\[\e[1;33m\]\d \[\e[1;34m\]\t \[\e[1;35m\]\u\[\e[1;36m\]@\[\e[1;31m\]\h\[\e[1;33m\](\[\e[1;36m\]\w\[\e[1;33m\])\[\e[1;35m\]]\[\e[1;37m\]% \e[m' | |
alias docs='cd ~/Documents' | |
alias h=history | |
alias mx="chmod a+x" |
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 | |
from gtk import Clipboard | |
import sys | |
def clip_in(text): | |
cb = Clipboard() | |
cb.set_text(text) | |
cb.store() |
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
# create a folder, for hacking, if !exist | |
mkdir -p tmp |
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
# User specific environment and startup programs | |
# original | |
#PATH=$PATH:$HOME/bin | |
# via Copy - so its backed up | |
PATH=$PATH:$HOME/Copy/bin | |
export PATH |
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
FOLDER_YESTERDAY=`date +%Y%m%d --date=yesterday` | |
FOLDER_TODAY=`date +%Y%m%d` | |
mkdir -p "${FOLDER_TODAY}" | |
mv "${FOLDER_YESTERDAY}"/*.log "${FOLDER_TODAY}/" |
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/bash | |
epoch=$(date +%s) | |
t=$(date +%Y_%m_%d_%H_%M_%S) | |
sleep 0.1 | |
echo $epoch |
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
tr -d '\r' < print.sh > moo.sh |