Skip to content

Instantly share code, notes, and snippets.

View foursixnine's full-sized avatar
♾️
Dreaming about arepas and maria cookies!

Santiago Zarate foursixnine

♾️
Dreaming about arepas and maria cookies!
View GitHub Profile
@foursixnine
foursixnine / caching_cleaner.pl
Created April 3, 2017 14:35
Enforce caching cleanup
use strict;
use warnings;
use File::Basename;
use Fcntl qw(:flock);
use List::MoreUtils;
use Data::Dumper;
use JSON;
use File::Glob;

Keybase proof

I hereby claim:

  • I am foursixnine on github.
  • I am foursixnine (https://keybase.io/foursixnine) on keybase.
  • I have a public key whose fingerprint is 49F9 6417 5666 EC92 7FC7 EE8E 7005 DF57 B449 9E20

To claim this, I am signing this object:

@foursixnine
foursixnine / bypass-passphrase-on-luks.sh
Last active April 2, 2017 20:16
Add LUKS passphrase without knowing the actual password
# This will work if you have still access to the partition
# and of course, you need root access for this :)
export firstpassword="This is the old password"
export new_password="This is the new password"
export loopdev=/dev/loop0
export device=/tmp/$(date +%Y%M%d)-testdev.img
export volume_name=/dev/mapper/crypt_fun
dd if=/dev/zero of=testdev bs=1M count=500
losetup $loopdev $device
@foursixnine
foursixnine / mojo-progress-bar.pl
Last active June 20, 2017 11:46 — forked from olegwtf/gist:c9c5a266352cba73dc5b
Mojo::UserAgent progress bar
BEGIN { $ENV{MOJO_MAX_MESSAGE_SIZE} = 1024**3 }
use strict;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
$ua->on(start => sub {
my ($ua, $tx) = @_;
my $progress = 0;
$tx->res->on(progress => sub {
@foursixnine
foursixnine / kickstart.sh
Last active December 20, 2016 10:26
quickly setup travis commits
ssh-keygen -N '' -f .openqa-travis
travis.ruby2.2 --github-token ${YOURGHTOKEN} encrypt-file .openqa-travis
travis.ruby2.2 encrypt-file .openqa-travis
# add line on your .travis as requested
git add .openqa-travis.enc
echo .gitignore .openqa-travis >> .gitignore
cat .openqa-travis.pub # Add the new key to your deploy keys on github with write-access
git commit --amend .travis.yml .gitignore .openqa-travis.enc
# check https://docs.travis-ci.com/user/encryption-keys/ and https://github.com/jirutka/rake-jekyll for more info https://oncletom.io/2016/travis-ssh-deploy/
@foursixnine
foursixnine / A.pm
Last active December 13, 2016 11:34
Module export test
package PackageTesting::A;
use strict;
use warnings;
use Exporter qw(import);
our @EXPORT = qw(a b);
sub whowasi { ( caller(2) )[3] }
sub a {
my ($called_from) = whowasi();
@foursixnine
foursixnine / linktest.pm
Created December 6, 2016 14:11
Quick test to see if using unlink is fast enough vs just symlinking directly.
use strict;
use warnings;
use Benchmark::Stopwatch;
my $stopwatch = Benchmark::Stopwatch->new->start;
my $i = 0;
$stopwatch->lap("start");
opendir(my $dh, ".") || die "Can't open dir : $!";
@foursixnine
foursixnine / tmux links
Created November 30, 2016 13:16
Useful tmux links i've personally used
#cd to your local openQA webui repository
#cd suse.com/github.com/os-autoinst/openQA
#If the setup for the development scenario involves sharing /var/lib/openqa, it would be wise to have a shared group openqa, that will have write and execute permissions over said directory, so that geekotest user and the normal development user can share the environment without problems.
# chmod -R g+rwx /var/lib/openqa/
# chgrp -R openqa /var/lib/openqa can’t fix
#start the local (yours) webui
script/openqa gru -m production run & sleep 1;
@foursixnine
foursixnine / aptly-api.conf
Last active September 5, 2016 21:50 — forked from sepulworld/aptly-api.conf
Aptly API upstart
description "Stat HTTP server with aptly REST API"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
respawn
umask 022
chdir /
setuid smartmatic
setgid smartmatic
console log # log stdout/stderr to /var/log/upstart/