Skip to content

Instantly share code, notes, and snippets.


Sebastian Spieszko ciastek

View GitHub Profile
ciastek / private.xml
Last active Oct 25, 2016 — forked from Quenz/private.xml
Steam Controller fixes, for Karabiner
View private.xml
<?xml version="1.0"?>
<name>Steam Controller fixes</name>
<name>Volume Up [from F17]</name>
<device_only>DeviceVendor::RawValue::0x28de, DeviceProduct::RawValue::0x1147</device_only>
<autogen>__KeyToKey__ KeyCode::F17, ConsumerKeyCode::VOLUME_UP</autogen>

Keybase proof

I hereby claim:

  • I am ciastek on github.
  • I am sspieszko ( on keybase.
  • I have a public key ASASxprsx6ioY8U3BWQ178CgN04EIhrnm4FiRZd_-5n4mwo

To claim this, I am signing this object:

ciastek / README
Created Feb 23, 2016 — forked from anonymous/README
Use bootstrap-sass npm package with Phoenix's brunch
1) install npm packages
2) update brunch-config.js
3) remove Bootstrap from web/static/css/app.css
4) rename web/static/css/app.css to web/static/css/app.scss
5) update web/static/css/app.scss
View gist:b9d64d31bf473b2aaf77
vagrant@ubuntu:~$ curl --head
curl: (6) Could not resolve host:
vagrant@ubuntu:~$ curl --head --ipv4
HTTP/1.1 301 Moved Permanently
vagrant@ubuntu:~$ sudo sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
vagrant@ubuntu:~$ ip addr
ciastek / gist:4f37888d82b805848cd2
Created Jun 8, 2014
JPG+EXIF, add timezone info
View gist:4f37888d82b805848cd2
EXIF doesn't support timezone info, but XMP do.
Add XMP tag with timezone info based on EXIF tag:
$ exiftool '-xmp:dateTimeOriginal<${CreateDate}+02:00' dir-with-images
ciastek / README
Last active Jan 11, 2019
[SOLVED] Why sudo asks for user password in tmux/ssh session?
In console:
root# passwd -d user
In console:
login: user
user$ sudo whoami
user$ tmux
View gist:9972602
$ rvm requirements ruby-2.1.0 --autolibs=fail
Checking requirements for suse.
/srv/app/.rvm/scripts/functions/pkg: line 6: pkg-config: command not found
Missing custom packages: yaml
$ rvm requirements ruby-2.1.0 --autolibs=disable
ciastek / gist:9389264
Created Mar 6, 2014
delayed_job + upstart
View gist:9389264
description "Start up app's delayed_job"
start on runlevel [2345]
stop on runlevel [06]
exec sudo -u rate bash -c 'export RAILS_ENV=production && cd /var/www/app/current && ./script/delayed_job start'
end script
ciastek / lxc-attach substitute
Created Jan 22, 2014
Run script in LXC container, non-interactive
View lxc-attach substitute
# create container with key authentication
sudo lxc-create -t ubuntu -n test -- -S /root/.ssh/
sudo lxc-start -n test -d
sudo lxc-wait -n test -s RUNNING
# enable passwordless sudo for ubuntu user
chroot /var/lib/lxc/test/rootfs sh -c "echo 'ubuntu ALL=NOPASSWD:ALL' > /etc/sudoers.d/ubuntu; chmod 440 /etc/sudoers.d/ubuntu"
# now you can run commands in container, example: install avahi-daemon
ssh `cat /var/lib/misc/dnsmasq.leases | grep --word-regexp test | awk '{print $3}'` -l ubuntu -o "StrictHostKeyChecking no" sudo apt-get install -y avahi-daemon
ciastek / fatfree-to-highrise.rb
Created Apr 3, 2013
Export contacts from Fat Free CRM and import into Highrise. Copied from .
View fatfree-to-highrise.rb
class Export
def perform
@contacts = Contact.where('id > ?', 272)
@organizations = Account.where('id > ?', 261)
@single_address_field = Setting.single_address_field
unless @contacts.blank?
require 'csv'
csv_string = CSV.generate(force_quotes: true, row_sep: "\r\n") do |csv|
csv << ['Name' , 'First name', 'Last name', 'Company', 'Title', 'Background', 'LinkedIn URL', 'Address - Work Street', 'Address - Work City', 'Address - Work State', 'Address - Work Zip', 'Address - Work Country', 'Address - Home Street', 'Address - Home City', 'Address - Home State', 'Address - Home Zip', 'Address - Home Country', 'Address - Other Street', 'Address - Other City', 'Address - Other State', 'Address - Other Zip', 'Address - Other Country', 'Phone number - Work', 'Phone number - Mobile', 'Phone number - Fax', 'Phone number - Pager', 'Phone number - Home', 'Phone number - Skype', 'Phone number - Other', 'Email address - Work', 'Email address - Home', 'Email address - Other', 'Web address