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
#!/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/sh | |
CSS=$1 | |
read -r -d '' SNIPPET << EOM | |
<style:style style:name="codehilite" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name=""> | |
<loext:graphic-properties draw:fill="solid" draw:fill-color="\2" draw:fill-image-width="0in" draw:fill-image-height="0in"\/> | |
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:orphans="0" fo:widows="0" fo:text-indent="0in" style:auto-text-indent="false" style:page-number="auto" fo:background-color="\2" fo:padding="0.0201in" fo:border="0.06pt solid \2" fo:keep-with-next="auto" style:snap-to-layout-grid="false" style:writing-mode="page"> | |
<style:tab-stops\/> | |
<\/style:paragraph-properties> |
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
#include <math.h> | |
#include <stdio.h> | |
#include <stdarg.h> | |
#include <sys/types.h> | |
#include "log.h" | |
struct testss{ | |
u_long level; | |
const char *name; | |
} log_names[] = { |
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
$ nano /etc/gitlab/gitlab.rb | |
nginx['custom_nginx_config'] = "include /var/opt/gitlab/nginx/conf/webtools.zharfpouyan.net;" | |
$ nano /var/opt/gitlab/nginx/conf/webtools.zharfpouyan.net | |
server { | |
listen *:80; | |
server_name webtools.zharfpouyan.net; | |
access_log /var/log/webtools.zharfpouyan.net.access.log; | |
error_log /var/log/webtools.zharfpouyan.net.error.log; |
OlderNewer