Skip to content

Instantly share code, notes, and snippets.

View pzskc383's full-sized avatar

Alexander D. pzskc383

View GitHub Profile
#!env bash
func1() {
echo func1 called with "$@"
}
func2() {
echo $(date '+%s') "$@"
}
URxvt*.foreground: #191a1b
URxvt*.background: #cacdca
URxvt*.color0: #191a1b
URxvt*.color8: #827f86
URxvt*.color7: #dfdfdf
URxvt*.color15: #f6f5f2
URxvt*.color1: #801124
URxvt*.color9: #ea2d16
URxvt*.color2: #007732
URxvt*.color10: #03922f
@pzskc383
pzskc383 / apm_partition_table.ksy
Created November 28, 2019 04:14
apm_partition_table.ksy
meta:
id: apm_partition_table (bit better wrong)
title: APM (Apple Partition Map) partition table
license: CC0-1.0
endian: be
encoding: ascii
doc-ref: Specification taken from https://en.wikipedia.org/wiki/Apple_Partition_Map
doc-ref: https://opensource.apple.com/source/pdisk/pdisk-9/dpme.h.auto.html
doc-ref: https://opensource.apple.com/source/IOStorageFamily/IOStorageFamily-92.9/IOApplePartitionScheme.h.auto.html
types:
@pzskc383
pzskc383 / defaults_unicorn_app
Created February 1, 2018 20:39 — forked from AlexeyDemidov/defaults_unicorn_app
Unicorn service file for systemd with rvm support
# save this file in /etc/default/unicorn_app
USER=app_user
APP_ROOT=/srv/app
RVM_STRING=2.2.4@app_gemset
RACK_ENV=production
UNICORN_OPTS="-D -c /srv/app/shared/config/unicorn.rb -E production"
DAEMON=unicorn
#!env ruby
# offlineimap --info >| ~/tmp/offlineimap.info.output 2>&1
output = File.join(ENV['HOME'], 'tmp/offlineimap.info.output')
config = File.join(ENV['HOME'], '.offlineimaprc')
def parse_ini(file)
data = {}
f = File.open(file, 'r')
section = "no-section"
f.each_line do |l|
@pzskc383
pzskc383 / keybase.md
Created October 27, 2014 13:52
keybase.md

Keybase proof

I hereby claim:

  • I am pzskc383 on github.
  • I am pzskc383 (https://keybase.io/pzskc383) on keybase.
  • I have a public key whose fingerprint is 8B59 99E0 491E 7883 8CA2 AFA1 28BE 5747 C442 7E7E

To claim this, I am signing this object:

TralbumData.trackinfo.map(function(t, i) { return 'wget "' + t.file['mp3-128'] + '" -O "'+(i+1)+'. '+t.title+'.mp3"'; }).join("\n");
@pzskc383
pzskc383 / deploy.rb
Created September 2, 2013 14:23
capistrano thingy to restart workers in tmux
set :tmux_session, "mailer"
desc 'Restart workers'
task :workers do
tmux_window = 'workers'
num_workers = 4
worker_cmd = "'php #{current_release}/bin/worker.php'"
exists = true
run "tmux start"
@pzskc383
pzskc383 / my.cnf
Last active December 19, 2015 22:28
start() in /etc/init.d/mysql on openrc
# /etc/mysql/my.cnf: The global mysql configuration file.
# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-5.1,v 1.4 2013/01/20 02:40:02 robbat2 Exp $
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3307
socket = /var/run/mysqld/mysqld-rd.sock
[mysql]
#!/bin/sh
[[ $# > 2 || $# < 1 ]] && exit 1;
[[! hash pass 2>&-]] && exit 2
IFS=$'\n' data=($(pass work/sql-$1))
cmd=" -p'${data[0]}'"
for (( i=1; i<${#data[@]}; i++ )); do