This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for component in "dtk-client" "dtk-common" "dtk-common-repo" "server" "dtk-repo-manager" "dtk-admin-application" "common" | |
do | |
if [ -d "$HOME/$component" ]; then | |
echo "Updating $HOME/$component ..." | |
git --git-dir="$HOME/$component/.git" --work-tree="$HOME/$component" clean -f | |
git --git-dir="$HOME/$component/.git" --work-tree="$HOME/$component" checkout . | |
git --git-dir="$HOME/$component/.git" --work-tree="$HOME/$component" pull | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -z $1 ]; | |
then | |
client_branch="master" | |
else | |
client_branch=$1 | |
fi | |
if [ -z $2 ]; | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UBUNTU SET RM ALL | |
alias rm-all='git rm $(git ls-files --deleted)' | |
WINDOWS SET RM ALL | |
doskey rm-all=bash -c "git rm $(git ls-files --deleted)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
# no stdout buffering | |
STDOUT.sync = true | |
# checks for windows/unix for chaining commands | |
OS_COMMAND_CHAIN = RUBY_PLATFORM =~ /mswin|mingw|cygwin/ ? "&" : ";" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Takes possible invalid UTF-8 output and ignores invalid bytes | |
# | |
# http://po-ru.com/diary/fixing-invalid-utf-8-in-ruby-revisited/ | |
def self.normalize_to_utf8_output(response) | |
if response[:data] | |
ic = Iconv.new('UTF-8//IGNORE', 'UTF-8') | |
output = response[:data][:output]||'' | |
valid_output = ic.iconv(output + ' ')[0..-2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
houses = ['Lannister','Stark','Grayjoy','Baratheon','Tyrell','Martel'] | |
players = ['Nera','Asaf','Keno','Aki','Haris','Zaharije'] | |
while !houses.empty? do | |
puts "#{players.delete_at(rand(players.length))} :: #{houses.delete_at(rand(houses.length))}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output = `dtk account list-ssh-keys` | |
output = output.split(/\n/) | |
output.each do |line| | |
match = line.match(/[0-9]+ \| (.*) \|/) | |
if match | |
identifier = match[1] | |
puts "Deleting #{identifier} ..." | |
puts `dtk account delete-ssh-key #{identifier}` | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileFilter; | |
public class Main { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
System.out.println(searchFile("test.pp", new File("/Users/haris/r8"))); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'puppet' | |
puppet_params = { | |
:name => 'foo', | |
:ensure => 'present', | |
:key => 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDH1chpGVgtqgdXh62qS1V2g8Ic2nbpfXgzXAseObYYocOa0NIeCOmFxbMEhzT9h6/EhYTpF6tq0Gn8aBBd8gb90OlHdTIZ2j9IVhqLxmwnUJ3lwTbq6cEdVy1M/TM+A/TygRcqRrbNgoswGaVem | |
lfk7caeenN2KxG3vjzq5cCIAhGD7DeI9qQawZuKdJOCOgqUL6rF/J9nyyzPAS5uCeQumncGR+cfrywe9ZCUJrUbrWeYFHtB0d3XhbxCYJIqui3kMmbhQzsLGka9tcWQ1Zwm7VpcIrgerEyHO+0aNusG1szvxQkVWk1Bi7RI8fNLaogSq+HqkU2CRH | |
nEk7arJa9t', | |
:type => 'ssh-rsa', | |
:user => 'ubuntu' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## User configuration | |
{ | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"color_scheme": "Packages/User/Monokai Soda.tmTheme", | |
"font_face": "DejaVu Sans Mono", | |
"font_size": 10.0, | |
"highlight_line": true, | |
"ignored_packages": |
OlderNewer