Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
bashing keybindings

Ronen narkisr

⌨️
bashing keybindings
View GitHub Profile
@narkisr
narkisr / chef-preq.sh
Last active Aug 29, 2015
Setting up chef
View chef-preq.sh
if cat /proc/version | grep Ubuntu
then
apt-get install git ruby1.9.1 ruby1.9.1-dev rubygems1.9.1 make -y
elif [ -f /etc/debian_version ];
then
apt-get install git ruby1.9.1 ruby1.9.1-dev rubygems -y
fi
if cat /proc/version | grep Red
then
@narkisr
narkisr / keybase.md
Last active Aug 29, 2015
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am narkisr on github.
  • I am narkisr (https://keybase.io/narkisr) on keybase.
  • I have a public key whose fingerprint is 2310 0151 F9AF A466 FD0F B844 82D9 CBE3 73EE 6174

To claim this, I am signing this object:

View celestial.sh
# No warranties of any kind. Works for me.
# Make sure to edit all XXX marked places in this file before using it.
export CELESTIAL_LAST_JOB_FILE=~/.celestial.last-job
function C() {
# Expects "user:pass" in ~/.celestial-creds
u="$1"
shift
View gist:148668
public <T> String toAmf(final T source) throws IOException {
final StringBuffer buffer = new StringBuffer();
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
final Provider<SerializationContext> provider = new SerializationContextProvider();// creating the provider
final Amf3Output amf3Output = new Amf3Output(provider.get());// creating the context instance
amf3Output.setOutputStream(bout);
amf3Output.writeObject(source);
amf3Output.flush();
amf3Output.close();
final BASE64Encoder encoder = new BASE64Encoder();
View Maven2Gradle.groovy
/*
* Copyright 2007-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
View snipplr-export.rb
require 'yaml'
require 'ostruct'
require 'xmlrpc/client'
require "cgi"
key = "34af1ea48bef1d5ed090"
server = XMLRPC::Client.new( "snipplr.com", "/xml-rpc.php")
server.call("user.checkkey", key)
hashes = server.call("snippet.list",key)
View xml-playground.groovy
class SpeculationDTO {
private int value1;
private double value2;
}
def xml = """
View analytics
<script type="text/javascript">//<![CDATA[
var gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//]]></script>]
<script type="text/javascript">//<![CDATA[
try {
var pageTracker = _gat._getTracker('UA-3291642-5');
pageTracker._trackPageview();
} catch(err) {}
//]]></script>
View uam.log
Tue Jan 18 22:37:21 IST 2011
+ hook_exec pre-umount
+ local hooktype fn
+ hooktype=pre-umount
+ [ -d /etc/udev/uam-hooks/pre-umount ]
+ [ -f /etc/udev/uam-hooks/pre-umount/* ]
+ debug Starting uam umounter on /dev/sdc1.
+ bool 1
+ [ -n ]
+ return 0
View uam.conf
# NOTE:
# This is just a sourced bash script, so think what you put here.
# If you'd like to use $ sign, you must enclose string in '' or escape it.
# If you'd like to use some other variable, feel free to use it.
# In booleans 1, 'y', 't', 'yes', 'true' and 'on' evaluate as true.
# Whether to log progress verbosely, or just print a plain summary at the end.
VERBOSE=1