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 | |
if (( $# != 1 )) ; then | |
echo -e "USAGE: $0 program"; | |
fi | |
# For use with Debian | |
# Instead use -> exists=$(dpkg -s $1 | awk -F: '/Package:/{print $2}' | sed 's/^[ \t]*//'); | |
exists=$(pacman -Q $1 | awk '{ print $1}'); |
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 | |
if (( $# != 3 )) ; then echo -e "USAGE: infile.avi outfile title"; exit; fi | |
ffmpeg -i $1 -acodec libmp3lame -metadata TITLE="$3" ${2}.mp3 |
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/sh | |
if mount | grep "system*.*ro"; then | |
echo -e "\nRemounting system as R/W.\n" && | |
mount -o remount,rw $(mount | awk '/system/ {print $1}' | sed 's/\/system/ \/system/g'; | |
else | |
echo -e "\nSystem is already mounted as R/W.\n"; | |
fi |
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 | |
# | |
# Grabs each iface and its respective overruns variables, ties them all together | |
# and pushes them into the res variable. Resulting in a line for every iface. | |
res=$(readarray -t mon < <(cat ifconfig | \ | |
awk '/w[a-z]*[0-9]/,/TX.*overruns:[0-9]/{print}'); echo "${mon[@]}" | \ | |
egrep -o "(w[a-z]*[0-9]|overruns:[0-9]{1,99})" | \ | |
sed -e 'N;N;s/\n/ /g'); | |
readarray -t fin < <(echo "$res"); |
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 | |
# | |
# git-slim | |
# | |
# Remove big files from git repo history. | |
# | |
# Requires GitPython (https://github.com/gitpython-developers/GitPython) | |
# | |
# References: | |
# - http://help.github.com/remove-sensitive-data/ |
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
mcl plex0spa | |
mcl> rtrv-route-digits::MTT-CDPN-NATNUM-73278424; | |
#save rd_73278424 | |
cat rd_73278424 | grep -o "MTT-CDPN-NATNUM-[0-9]\{10\}:RTDEST=RTLIST-VOIP" | sed -e 's/MTT-CDPN-NATNUM-[0-9]\{10\}:RTDEST=RTLIST-VOIP/ED-ROUTE-DIGITS::&_CNAM;/g;s/:RTDEST/:::RTDEST/g' | |
The above can be used in place of any number. |
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/ruby | |
# | |
# ivad_driver.rb is closely related to the rails application | |
# located at https://mtt4.monmouth.com/ivad. | |
# ivad_driver.rb's job is to read the pending operations from the database | |
# (that the web app writes to) and perform the modification on the necessary | |
# equipment as well as update the callerid and whodunit tables | |
require "/etc/ivad/ivad_rails_env_config" | |
require 'ivad/simple_factory' |
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
$ irb -r ./select_server | |
>> client.puts "hi" | |
=> nil | |
>> client.puts "bye" | |
=> nil | |
>> client.close | |
=> nil | |
>> exit |
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
eth0 Link encap:Ethernet HWaddr 78:24:af:6e:a6:60 | |
UP BROADCAST MULTICAST MTU:1500 Metric:1 | |
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:1000 | |
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | |
lo Link encap:Local Loopback | |
inet addr:127.0.0.1 Mask:255.0.0.0 | |
inet6 addr: ::1/128 Scope:Host |
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 | |
mkv=$1 | |
if [[ ! -e $mkv ]]; then | |
echo -e "No such file or directory.\n"; | |
exit; | |
elif [[ $mkv == `echo $mkv | egrep "/"` ]]; then | |
parsed_name=$(echo $mkv | awk '{gsub(/\//, " "); print $NF}'); | |
parsed_path=$(echo $mkv | sed 's/\(\/.*\/\)\(.*$\)/\1/g'); |
OlderNewer