Skip to content

Instantly share code, notes, and snippets.

View pstaender's full-sized avatar
👾
extra terrestrial

Philipp Staender pstaender

👾
extra terrestrial
  • Cologne, Germany
View GitHub Profile
@pstaender
pstaender / .nord_vpn_auth
Last active October 28, 2018 18:13
Open NordVPN easiliy via cli with country as argument and checking for newest server files
youremail
yourpassword
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.19370138645172119</real>
#target Illustrator
// script.name = exportLayersAsCSS_PNGs.jsx;
// script.description = mimics the Save for Web;
// script.requirements = an open document; tested with CS5 on Windows.
// script.parent = carlos canto // 05/24/13; All rights reserved
// script.elegant = false;
// Source: http://graphicdesign.stackexchange.com/questions/20459/how-to-export-illustrator-layers-as-individual-images
@pstaender
pstaender / mysql_to_csv.sh
Created December 5, 2016 14:25
mysqldump to csv
mysql -B -u username -p password database -h dbhost -e "SELECT * FROM accounts;" \ | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g"
@pstaender
pstaender / tar_untar_crypted.sh
Last active August 24, 2018 07:59
Crypt and Decrypt gzipped tar files in bash
function tarcrypt {
file=$1
filename="$file.tar.gz.enc"
if [ -f $file ]; then
echo "-> $filename"
tar cz $file | openssl enc -aes-256-cbc -e > $filename
elif [ -d $file ]; then
echo "-> directory $filename"
# display progress
# linux: tar cf - $file -P | pv -s $(du -sb $file | awk '{print $1}') | gzip > big-files.tar.gz
@pstaender
pstaender / png2pdf.sh
Last active September 27, 2022 04:26
OpenSource OCR for Mac OS
#!/bin/bash
# For Macs:
# brew install tesseract --with-all-languages
echo "Hint: Prepare all png images as valid OCR input before starting convert process"
if [[ "$1" != "" ]]; then
files="$1"
else
#!/bin/sh
# source: http://superuser.com/a/162628/398757
function tarcrypt {
file=$1
filename="$file.tar.gz.enc"
if [ -f $file ]; then
echo "-> $filename"
tar cz $file | openssl enc -aes-256-cbc -e > $filename
fi
<?php
$pass = 'yourpassword';
$user = 'yourusername';
// which config file to update
$nginxFile = '/etc/nginx/sites-enabled/mydyndns.domain.com';
$authUser = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : null;
$authPass = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : null;
#!/bin/sh
# output chrome console on your MAC terminal
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-logging --v=1 &
sleep 5
tail -f "$HOME/Library/Application Support/Google/Chrome/chrome_debug.log" | egrep "(INFO|ERROR)\\:CONSOLE"
@pstaender
pstaender / latex2plaintext.coffee
Created March 23, 2016 00:37
Convert basic latex to plaintext
#!/usr/bin/env coffee
process.stdin.on 'data', (s) ->
line = s.toString().replace(/\n/g, '_newline_')
replaceRuleset = [
# remove tables
[ /\\begin\{(table)\}.*?\\end\{(table)\}/ig, '' ]
# remove tables
[ /\\begin\{(tabular)\}.*?\\end\{(tabular)\}/ig, '' ]