Skip to content

Instantly share code, notes, and snippets.

View nask0's full-sized avatar
👾
nothing

nask0 nask0

👾
nothing
  • ...somewhere in time!
View GitHub Profile
#!/bin/bash
# vim: set sts=4 sw=4 et tw=0 :
#
# License: BSD
AUTOMAGIC_MODE="false"
: ${XWININFO:=$(type -P xwininfo)}
[[ -z ${XWININFO} ]] && { echo "You need to install xwininfo"; exit 1; }
: ${XPROP:=$(type -P xprop)}
@nask0
nask0 / git-loglive
Created October 23, 2013 09:49 — forked from sherman/git-loglive
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
sleep 1
done
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@nask0
nask0 / aescrypt.py
Created October 8, 2015 06:59 — forked from SpotlightKid/aescrypt.py
Encrypt/decrypt files with symmetric AES cipher-block chaining (CBC) mode.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Encrypt/decrypt files with symmetric AES cipher-block chaining (CBC) mode.
Usage:
File Encryption:
aescrypt.py [-f] infile [outfile]
@nask0
nask0 / postbank.location.js
Created March 29, 2016 19:29 — forked from miglen/postbank.location.js
postbank.location.js
/*
Този скрипт е пълен с едни от най-забавните коментари на български.
Разработен е от някой от разработчиците на Iliyan.com за Пощенска банка.
Пазя го за да се смеем ако го променят в сайта.
Оригинална локация: https://www.postbank.bg/Applications/Locations/_inc/js/locations.js
*/
@nask0
nask0 / web2csv.py
Created March 29, 2016 19:30 — forked from miglen/web2csv.py
Dead simple {for devs} python crawler (script) for extracting structured data from any website into CSV
#!/bin/env/python
#
# Source: http://blog.webhose.io/2015/08/16/dead-simple-for-devs-python-crawler-script-for-extracting-structured-data-from-any-almost-website-into-csv/
import sys, thread, Queue, re, urllib2, urlparse, time, csv
### Set the site you want to crawl & the patterns of the fields you want to extract ###
siteToCrawl = "http://www.amazon.com/"
fields = {}
fields["Title"] = '<title>(.*?)</title>'
fields["Rating"] = 'title="(S+) out of 5 stars"'
@nask0
nask0 / bash-cheatsheet.sh
Created May 10, 2016 07:14 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@nask0
nask0 / postgres-cheatsheet.md
Created June 8, 2016 14:48 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@nask0
nask0 / vpn_psk_bingo.md
Created July 12, 2016 09:17 — forked from kennwhite/vpn_psk_bingo.md
Most VPN Services are Terrible
@nask0
nask0 / install-libsodium.sh
Created July 15, 2016 08:38 — forked from sarciszewski/install-libsodium.sh
Install libsodium-1.0.2 and PECL libsodium on Ubuntu 14.04
#!/usr/bin/env bash
PECLVER="0.1.1"
LIBSODIUMVER="1.0.2"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi