Skip to content

Instantly share code, notes, and snippets.

View mrdaemon's full-sized avatar

Alexandre Gauthier mrdaemon

View GitHub Profile
# Dee's tmux configuration file
# start window indexing at one instead of zero
set -g base-index 1
# Bell in any window results in term bell
set -g bell-action any
# Home as default path
set -g default-path ~/
@mrdaemon
mrdaemon / hello.vala
Created March 28, 2012 17:03
lol vala
public class HelloWorld : Object {
public string name { get ; set; default = "World"; }
public HelloWorld() {
/* Huh. With properties accessed like fields,
and able to have default values, turns out I don't
actually have to do this. At all. Sweet shorthand,
Vala. Your syntactic sugar is growing on me. */
//this.with_name("World");
}
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.
In [1]: from local.api import MicrosoftTranslator
In [2]: azurekey="AzUr3k4yGoesTH3reLOLandStuFF="
In [3]: translator = MicrosoftTranslator(azurekey)
In [4]: translator.languages
Out[4]: ['ar', 'bg', 'ca', 'zh-CHS', 'zh-CHT', 'cs', 'da', 'nl', 'en', 'et', 'fi', 'fr', 'de', 'el', ht', 'he', 'hi', 'mww', 'hu', 'id', 'it', 'ja', 'ko', 'lv', 'lt', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', sl', 'es', 'sv', 'th', 'tr', 'uk', 'vi']
In [5]: translator.translate(source="fr", target="en", text="Bonjour, je suis un Dee")
Out[5]: 'Hello, I am a Dee'
/* trim: remove trailing blanks, tabs, newlines */
int trim(char s[])
{
int n;
for (n = strlen(s)-1; n >= 0; n--)
if (s[n] != ' ' && s[n] != '\t' && s[n] != '\n')
break;
s[n+1] = '\0';
return n;
[tech3@box ~]$ sudo systemctl status nginx.service
nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
Active: active (running) since Fri, 26 Oct 2012 15:43:28 -0400; 2s ago
Process: 3114 ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=0/SUCCESS)
Process: 3121 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 3118 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Main PID: 3122 (nginx)
CGroup: name=systemd:/system/nginx.service
├ 3122 nginx: master process /usr/sbin/nginx
@mrdaemon
mrdaemon / .bashrc
Created November 22, 2012 03:02
Tmux configuration
# whatever [...]
[[ -f ~/.tmux-bootstrap.sh ]] && source ~/.tmux-bootstrap.sh
[C:\Windows\system32]# smartctl -a C:\
smartctl 6.0 2012-10-10 r3643 [x86_64-w64-mingw32-win8] (sf-6.0-1)
Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org
Vendor: FUJITSU
Product: MBA3073RC
Revision: D305
User Capacity: 73 407 820 800 bytes [73,4 GB]
Logical block size: 512 bytes
Logical Unit id: 0x500000e01b102620
[0:523] callisto:Half-Life $ ls
bshift custom.hpk engine_i486.so hl_linux libsteam_api.so proxy.so valve_hd
bshift_hd czero ffmpegsumo.so htmlcache libsteam.dylib.dSYM redist valve_lv
chromehtml.dylib.dSYM czero_lv filesystem_stdio_amd64.so hw.dylib.dSYM libsteam.so reslists valve_old
chromehtml.so czeror filesystem_stdio.so hw.so libtier0.so ricochet vgui2.so
config.cfg dedicated gearbox libcef.dylib.dSYM libvstdlib.so SAVE vgui.so
core.so demoplayer.so gearbox_hd libcef.so localization tempdecal.wad voice_miles.so
crashhandler.so dmc gldrv libffmpegsumo.so logos tfc voice_silk.dyli
@mrdaemon
mrdaemon / apachelol.conf
Last active December 12, 2015 07:18
Example of namebased virtualhosts
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.asshole.com
ServerAlias asshole.com sub.asshole.com
DocumentRoot /var/www/asshole
</VirtualHost>
<VirtualHost *:80>
ServerName data.asshole.com
int[] currentPState = new int[4];
for(int i=0; i<4; i++) {
currentPState[i] = K10Manager.GetCurrentPState(i);
}