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 | |
TMP_FILE="/tmp/election" | |
wget -q http://election.farsnews.com/electioninfo.js -O $TMP_FILE | |
TOTAL=$(cat $TMP_FILE | grep -o "lastTotal = [0-9]\+" | sed "s/lastTotal = //" | sed "s/;//") | |
COUNTED=$(cat $TMP_FILE | grep -o "lastCounted = [0-9]\+" | sed "s/lastCounted = //" | sed "s/;//") | |
FAILED=$(cat $TMP_FILE | grep -o "lastFailed = [0-9]\+" | sed "s/lastFailed = //" | sed "s/;//") | |
UPDATE=$( cat $TMP_FILE | grep "categoryarray" | grep -o "[0-9:]\{5\}']" | sed "s/']//") |
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 | |
TMP_FILE="/tmp/election" | |
wget -qO- http://election.farsnews.com/electioninfo.js | sed 's/var //' | sed 's/ = /=/' | sed "s/\[/\(/" | sed "s/\]/\)/" > $TMP_FILE | |
source "$TMP_FILE" | |
echo "last Update: "${categoryarray[${#categoryarray[@]}-1]} | |
echo "$lastTotal ($lastCounted, $lastFailed)" | |
echo "%"$(echo "scale = 4; ($lastRohani / $lastTotal) * 100" | bc 2>/dev/null)" Rohani with $lastRohani votes" | |
echo "%"$(echo "scale = 4; ($lastQalibaf / $lastTotal) * 100" | bc 2>/dev/null)" Qalibaf with $lastQalibaf votes" |
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 | |
for i in `seq 1 42`; do | |
echo "retreiving page $i" | |
page_content=$(wget -q -O - "$@" http://iconmonstr.com/page/$i/) | |
echo ${page_content/$'\n'/} | grep -o "<svg [^>]*> <path [^>]*>" | while read svg; do | |
file_name=$(echo $svg | grep -o "id=\"[^\"]*\"" | sed 's/id="//' | sed 's/"//') | |
echo -en " ${file_name}.svg\t" | |
cat > ${file_name}.svg << EOF | |
<?xml version="1.0" encoding="utf-8"?> |
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 | |
# | |
# usage: certcheck hostname [port] | |
# | |
REMHOST=$1 | |
REMPORT=${2:-443} | |
echo |\ | |
openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |\ | |
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -sha1 -noout -fingerprint |
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 | |
echo "<?php" | |
curl -s http://www.nnvv.org/ | grep -m 2 -o "\(Password\|Username\):[a-zA-Z0-9\-]\+" | while read line; do | |
echo $line | sed 's/Username/\$user/' | sed 's/Password/\$pass/' | sed 's/:\(.*\)$/="\1";/' | |
done | |
echo "?>" |
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 | |
STEP="10" | |
UNIT="%" | |
SETVOL="/usr/bin/amixer -q sset Master" | |
STATE=$(amixer get Master | grep Left | egrep 'Playback.*?\[o' | egrep -o '\[o.+\]') | |
case "$1" in | |
"up") |
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 | |
# | |
# GetSoundcloud | |
# | |
# Copyright: 2014 Bijan Ebrahimi <[email protected]> | |
# | |
# You may distribute this file under the terms of the GNU General | |
# Public License as published by the Free Software Foundation; either | |
# version 3 of the License, or (at your option) any later version. | |
# |
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/env python2.7 | |
# Author: Bijan EBrahimi [[email protected]] | |
# License: GPL 3 or later | |
# Published: Sat Aug 2 01:11:11 IRDT 2014 | |
# | |
# Python Script to Bypass Captcha at Login page of TCI ADSL Provider | |
# to show remaining bandwidth. | |
# With Special thanks to @shabgard | |
# | |
# Dependencies: |
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 | |
# Geolocation meta data convertor (degree to decimal) | |
# Authur: Bijan Ebrahimi | |
# License: GPL v3.0 or any later | |
if [ ! "$#" == "1" ]; then | |
echo "Manual: `basename $0` JPG_FILE" | |
exit 1 | |
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
#~/usr/bin/env python2 | |
import os | |
import re | |
import imdb | |
import pickle | |
# TODO: use logger | |
ia = imdb.IMDb() | |
# TODO: expand ~/ | |
cache_dir = "/home/bijan/.imdbpy/cache" |
OlderNewer