View sub.py
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
p = "Hello world3 33" | |
import re | |
pfx = r"([a-zA-Z\)])" | |
p = re.sub(pfx + "0", r"\1₀", p) | |
p = re.sub(pfx + "1", r"\1₁", p) | |
p = re.sub(pfx + "2", r"\1₂", p) | |
p = re.sub(pfx + "3", r"\1₃", p) |
View beautify.js
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
var beautify = require('js-beautify').js; | |
var fs = require('fs'); | |
var ArgParser = require('argparse').ArgumentParser; | |
var http = require('http'); | |
var ap = ArgParser({}); | |
ap.addArgument('filename', { | |
'help': 'input js filename' | |
}); | |
ap.addArgument(['-s', '--source'], { |
View main1.rs
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
extern crate hyper; | |
use std::io::{self, Write}; | |
use hyper::Client; | |
use hyper::rt::{self, Future, Stream}; | |
fn main() { | |
rt::run(rt::lazy(|| { | |
let client = Client::new(); |
View Security checks
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
<1> | |
Usage: breach_check.sh <account> [detail] | |
e.g. | |
> ./breach_check.sh tom@facebook.com | |
found 6 breaches | |
BinWeevils | |
Edmodo | |
Evony | |
OnlinerSpambot |
View temperature.sh
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
curl -s wttr.in/mumbai | head -n 7 |
View vlc_dbus.sh
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 | |
# bash script using gdbus to call vlc dbus interface methods and get / set properties | |
iface='org.mpris.MediaPlayer2' | |
dest="$iface.vlc" | |
obj='/org/mpris/MediaPlayer2' | |
i_prop='org.freedesktop.DBus.Properties' |
View roomdark.sh
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 | |
filename=capture.ppm | |
streamer -o $filename >/dev/null 2>&1 | |
rgb=$(convert $filename -resize 1x1 txt:- | sed -n 2p | grep -Po "#\w+" | cut -c 2-) | |
if [[ 0x$rgb -lt 0x212121 ]] | |
then |
View firefox_visited.sh
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
sqlite3 `find ~/.mozilla/firefox -mindepth 1 -maxdepth 1 -type d -name *default*`/places.sqlite "SELECT url FROM moz_places;" | grep -Po "^http(s)?://(([a-zA-Z](-?[a-zA-Z0-9])*)\.)*[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}" | grep -Po "\..*?\." | tr -d . | sort | uniq -c | sort -n -r | head -n 10 | awk '{if (length($2)>9) e=".."; else e=""; printf "%s %s%s\n", $1, substr($2,1,9), e}' | gnuplot -e "set terminal wxt size 800, 300 title 'Most Visited Websites'; set boxwidth 0.3; set ylabel 'visits'; plot '<cat' using 1:xtic(2) with boxes fill solid lc rgb '#3B5998' title '`sqlite3 -separator ' ' \`find ~/.mozilla/firefox -mindepth 1 -maxdepth 1 -type d -name *default*\`/places.sqlite "select min(last_visit_date)/1000000, max(last_visit_date)/1000000 from moz_places;" | awk 'function d(t){return system("date +%d-%b-%Y --date=@" t)} {d($1) d($2)}' | awk -vFS="\n" -vRS= '{print $1, "to", $2}'`'" -p |