Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View aeris's full-sized avatar

aeris aeris

View GitHub Profile
@aeris
aeris / Main.java
Created September 14, 2011 20:47
Java interview question
class Foo1 {
String bar = "bar1";
String getBar() {
return this.bar;
}
void setBar(final String bar) {
this.bar = bar;
}
@aeris
aeris / rsync-snapshot.pl
Last active September 27, 2015 06:27
RSync Snapshot
#!/usr/bin/perl
END {
kill 15, -$$
}
`renice 10 $$`;
my $rs_conf = "/etc/rsync-snapshot.conf";
@aeris
aeris / dao.py
Created October 3, 2011 23:24
Possible architecture
# -*- coding: utf-8 -*-
"""
rhodecode.dao
~~~~~~~~~~~~~
Data access layer
:created_on: Oct 4, 2011
:author: nvinot
:copyright: (C) 2011 Nicolas VINOT <aeris@imirhil.fr>
@aeris
aeris / Main.java
Created November 4, 2011 20:59
Héritage et polymorphisme
public class Main {
private static class A {
protected void foo() {
System.out.println("A");
}
}
private static class B extends A {
@Override
protected void foo() {
@aeris
aeris / zshprompt
Created July 7, 2012 16:45
Git prompt for ZSH
autoload -U colors
colors
# Allow for functions in the prompt.
setopt prompt_subst
autoload -U add-zsh-hook
add-zsh-hook chpwd chpwd_update_git_vars
add-zsh-hook preexec preexec_update_git_vars
@aeris
aeris / zshprompt.sh
Last active October 7, 2015 02:58
ZSH SCM prompt
autoload -U colors
colors
# Allow for functions in the prompt.
setopt prompt_subst
autoload -U add-zsh-hook
add-zsh-hook chpwd update_scm_vars
add-zsh-hook preexec preexec_update_scm_vars
@aeris
aeris / addNetworkManagerConnection.py
Created August 1, 2012 21:51
Create Network Manager connection from command line
import dbus, struct, socket, uuid
def _ip(ip):
t = socket.inet_aton(ip)
return dbus.UInt32(struct.unpack("I", t)[0])
def _ips(ips):
return dbus.Array([_ip(ip) for ip in ips], signature=dbus.Signature('u'))
def _ip6(ip):
@aeris
aeris / bak.sh
Created August 8, 2012 08:57
Backup utility
#!/bin/bash
backup() {
mv "${1}" "${1}.bak"
}
restore() {
mv "${1}" "${1/%\.bak/}"
}
@aeris
aeris / ir_black.colorsheme
Created August 9, 2012 20:37
IR Black for Konsole
[Background]
Color=0,0,0
Transparency=false
[BackgroundIntense]
Bold=true
Color=44,44,44
Transparency=false
[Color0]
@aeris
aeris / mvn-activate.sh
Created September 2, 2012 19:48
Maven settings activator
#!/bin/bash
PROFILE=$1
MVN_HOME=~/.m2
SETTINGS_FILE=settings.xml
SETTINGS="${MVN_HOME}/${SETTINGS_FILE}"
if [ -z "$1" ]; then
rm -f "${SETTINGS}"
else