Skip to content

Instantly share code, notes, and snippets.

View KhasMek's full-sized avatar
⚠️
uncaught exception

Khas'Mek KhasMek

⚠️
uncaught exception
View GitHub Profile
@KhasMek
KhasMek / make_xml.sh
Created May 18, 2012 04:12
automation script for creating T-Mobile theme overlay xml files.
#!/bin/bash
package=${1}
# test for parent directory
if [ -d xml ]; then
echo "directory exists"
else
mkdir xml
fi
if [ -f .repo/local_manifest.xml ]; then
echo "local manifest already present."
echo "merging with kernel manifest for safety."
cat platform_manifest/kernel_manifest.xml | while read line
do
kernel=`grep "$line" .repo/local_manifest.xml`
if [ -z "$kernel" ]; then
echo " $line" >> .repo/local_manifest.xml
fi
done
@KhasMek
KhasMek / nuke.sh
Created May 31, 2012 18:54
find and remove all occurrences of a file easily... I'm so lazy.
#!/bin/bash
name=${1}
location=${2}
if [ ! "$location" ]; then
location=.
fi
find $location -name $name | while read line
@KhasMek
KhasMek / colorize.sh
Created June 6, 2012 04:07
simple script to find and colorize file in a folder(s)
#!/bin/bash
#
# A simple colorizer script for ImageMagick to batch modify
# resource images.
# -KhasMek
file=${1}
location=${2}
if [ ! "$location" ]; then
@KhasMek
KhasMek / colorize_rainbow.sh
Created June 7, 2012 17:00
simple script to find and colorize file in a folder(s) (rainbow edition)
#!/bin/bash
#
# A simple colorizer script for ImageMagick to batch modify
# resource images.
# -KhasMek
file=${1}
location=${2}
if [ ! "$location" ]; then
@KhasMek
KhasMek / so_much_profit.sh
Created June 7, 2012 18:16
SO MUCH PROFIT edition of my stupid colorize script.
#!/bin/bash
#
# A simple colorizer script for ImageMagick to batch modify
# resource images.
# -KhasMek
#
# Usage- run in the root folder of your theme directory. profit.
file=${1}
location=${2}
@KhasMek
KhasMek / changelog_gen.sh
Created June 15, 2012 16:43
just a unclean version in case I ever need to look back.
#!/bin/sh
sdate=${1}
cdate=`date +"%m_%d_%Y"`
rdir=`pwd`
# Check the date start range is set
if [ -z "$sdate" ]; then
echo "!!!!---- Start date not defined ----!!!!"
echo "Please define a start date in mm/dd/yyyy format."
@KhasMek
KhasMek / gimmie_pr0n.sh
Created July 12, 2012 17:30
I needed pr0n
#!/bin/bash
# A script to rape ilikevidsdaily.com
# By KhasMek lover of free pr0n.
# Download (or update) your reference files
# Legend: wget -r (recursive) -l2 (go two levels deep) "url"
wget -r -l1 -t1 http://ilikevidsdaily.com
# Find the embedded videos name
grep -ir video_file ilikevidsdaily.com/post/ | cut -f2 -d "'" | while read line
@KhasMek
KhasMek / commpare.sh
Created July 12, 2012 17:33
a quick test to compare my aokp builds to the stock aosp ota's to make some sort of decent gapps.
#!/bin/bash
find ./ -exec test ! -e ../aokp/{} ";" -print | while read line
do
cp --parents -rf $line ../out
done
echo complete
@KhasMek
KhasMek / make_lazy.sh
Created August 21, 2012 23:19
A quick script to clean up image file names by removing blank spaces, capitals, redundancies, and adding authorship. It then creates thumbnails and xml entries for later use
#!/bin/bash
# Super lazy way to get all the thing together to add
# more wallpapers to the SwagPapers (or similar) apps.
#
# USAGE: ./make_lazy $AUTHORS_NAME $FIELD_TO_REMOVE
# FIELD_TO_REMOVE is useful when the original author has
# added an aokp prefix to the image. We already know this
# will be an aokp related image, and is unneeded.
# Currently supported formats are .png and .jpg.
#