Skip to content

Instantly share code, notes, and snippets.

View viktorbenei's full-sized avatar

Viktor Benei viktorbenei

  • Bitrise Ltd (CTO & Cofounder)
  • Hungary
View GitHub Profile
@matthewmccullough
matthewmccullough / git-deletealltags.bsh
Created April 1, 2011 20:29
Script to delete all tags both locally and remotely
for t in `git tag`
do
git push origin :$t
git tag -d $t
done
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@sbusso
sbusso / simple_ruby_daemon.rb
Created March 5, 2012 13:50 — forked from mynameisrufus/.gitignore
Simple ruby daemon
#!/usr/bin/env ruby
# == Simple Daemon
#
# A simple ruby daemon that you copy and change as needed.
#
# === How does it work?
#
# All this program does is fork the current process (creates a copy of
# itself) then exits, the fork (child process) then goes on to run your
# daemon code. In this example we are just running a while loop with a
@nacho4d
nacho4d / Daemon in OSX Example
Created April 8, 2012 17:06
Daemon in OSX Example
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
# pragma mark Daemon Protocol
@protocol DaemonProtocol
- (void)performWork;
@end
# pragma mark MyTask Object Conforms to Protocol
@lukewpatterson
lukewpatterson / gist:4242707
Created December 9, 2012 00:24
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@raultm
raultm / commands.sh
Created November 11, 2013 23:05
Commands to convert Mavericks installer in Mavericks ISO Source : http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html
# Source : http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks
# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Mavericks.sparseimage
@jbinto
jbinto / howto-recover-google-authenticator-keys.txt
Created February 8, 2014 04:20
Recovering Google Authenticator keys from Android device for backup
### Last tested February 7 2014 on a Galaxy S3 (d2att) running Cyanogenmod 11 nightly, with Google Authenticator 2.49.
### Device with Google Authenticator must have root.
### Computer requires Android Developer Tools and SQLite 3.
### Connect your device in USB debugging mode.
$ cd /tmp
$ adb root
$ adb pull /data/data/com.google.android.apps.authenticator2/databases/databases
@viktorbenei
viktorbenei / gist:11367575
Created April 28, 2014 10:10
Auto increment build number of Xcode project
#
# Paste this into a new "Run Script" Build Phase (as described here: http://stackoverflow.com/a/15483906/974381)
#
# Tip: drag-and-drop your new Run Script to run before the "Compile Sources" Phase!
#
# Source: http://stackoverflow.com/a/15483906/974381
#
# How to get version numbers in code?
# NSString *buildString = infoDictionary[(NSString*)kCFBundleVersionKey];
# NSString *versionString = infoDictionary[@"CFBundleShortVersionString"];
@viktorbenei
viktorbenei / gist:cca967e09bf701aa9cb5
Last active March 19, 2018 09:39
Bash script to generate secure passwords
#
# requires 'pwgen', can be installed with brew
#
# add this to your .bash_profile, .profile or .bashrc for quick terminal access
# input: the length of the password
# usage example: gensecpsw 16
# example result: XjQ%uWQ.&7-T4@`(
#
gensecpsw() {
printf '%s' $(pwgen -B -c -s -n -y $1 1) |pbcopy; echo "Has been copied to clipboard"
@anildigital
anildigital / gist:862675ec1b7bccabc311
Created July 26, 2014 18:27
Remove dangling docker images
docker rmi $(docker images -q -f dangling=true)