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
DEPARTMENT OF PUBLIC HEALTH AND HUMAN SERVICES | 4041439825.4495 | |
---|---|---|
DEPARTMENT OF ADMINISTRATION | 2305045669.05002 | |
DEPARTMENT OF REVENUE | 1437437534.65 | |
DEPARTMENT OF TRANSPORTATION | 1263305003.25008 | |
OFFICE OF PUBLIC INSTRUCTION | 451130738.55 | |
MONTANA STATE FUND | 420293464.210003 | |
DEPARTMENT OF LABOR AND INDUSTRY | 404242881.190003 | |
DEPARTMENT OF COMMERCE | 365923960.079999 | |
COMMISSIONER OF HIGHER EDUCATION | 311434469.469999 | |
DEPARTMENT OF CORRECTIONS | 288275698.659999 |
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 . | grep -E '\.(c|h)$' | zip six.zip -@ |
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 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
x="zzzzz" | |
copies=() | |
CLEAN_DIR="/var/cache/pacman/pkg" |
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 | |
( echo "PACKAGE SIZE(K)"; | |
for A in /var/lib/pacman/local/*/desc; do | |
egrep -A1 '%(NAME|SIZE)' $A \ | |
| gawk '/^[a-z]/ { printf "%s ", $1 }; /^[0-9]/ { printf "%.0f\n", $1/1024 }' | |
done | sort -nrk2 ) | column -t |
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/env python | |
import inspect | |
import os | |
import sys | |
def get_script_dir(follow_symlinks=True): | |
if getattr(sys, 'frozen', False): # py2exe, PyInstaller, cx_Freeze | |
path = os.path.abspath(sys.executable) | |
else: |
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
# Reads out 5 random lines from a file and erases them | |
import os.path | |
import random | |
dictionary = open("/home/farhan/bin/words", "r") | |
words = set() | |
last_pos = dictionary.tell() | |
rand_words = list(dictionary) |
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
import xml.etree.ElementTree as etree | |
tree = etree.parse('/home/farhan/bin/email.xml') | |
root = tree.getroot() | |
for entry in root.iter('{http://purl.org/atom/ns#}entry'): | |
for title in entry.findall('{http://purl.org/atom/ns#}title'): | |
print ('TITLE: ', title.text) | |
for author in entry.findall('{http://purl.org/atom/ns#}author'): | |
for email in author.findall('{http://purl.org/atom/ns#}email'): |
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 | |
#utility to play a youtube video after the url has been cut using ctrl-x | |
youtube-dl -o "/home/farhan/Downloads/frmyoutube.%(ext)s" "$(xclip -o)" | tee /home/farhan/bin/play.log | |
#make sure we don't have any errors | |
if [ $(grep -i "error" ~/bin/play.log) ]; then | |
echo "Error downloading video. Try again :(" | |
exit 1 | |
fi |
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
(undecorate) |
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 | |
# free is a utility which provides statistics about memory in use | |
# -m flag provides memory in Mb | |
# awk takes all the arguments from grep and can print them | |
USED=`free -m | grep cache: | awk '{print $3}'` | |
TOTAL=`free -m | grep Mem: | awk '{print $2}'` | |
# bc is a linux calculator which can print floating point | |
# scale determines number of decimals (ex: 0.00) |