Skip to content

Instantly share code, notes, and snippets.

View oliwer's full-sized avatar
😤
Destroy, Erase, Improve

Olivier Duclos oliwer

😤
Destroy, Erase, Improve
View GitHub Profile
@oliwer
oliwer / hexspeak.txt
Created May 6, 2019 11:57
Hexspeak (magic debug values)
DEADBEEF
BADC0FFEE0DDF00D
DEAD10CC
0D15EA5E
FEEDFACE
ABADCAFE
BAAAAAAA
DEADFEED
DEFEC8ED
FEEDBACC
@oliwer
oliwer / awsenv.sh
Last active April 29, 2019 13:17
Script to set the current AWS profile
#!/bin/bash -eu
profile=${1:?usage: eval \`awsenv <profile>\`}
xp() { echo export "$*"; }
found=false
while read key eq value; do
if ! $found; then
if [ "$key" = "[$profile]" ]; then
found=true
xp AWS_DEFAULT_PROFILE=$profile
fi
@oliwer
oliwer / diamond.k
Last active April 5, 2019 15:09
Diamond in K7 (shakti)
/ diamond challenge in K7
/ http://badcode.rocks/2019/060/diamond/
/ usage: k diamond.k Z
ci:(*.z.x(1))-65 / get first arg as int (A=0)
diam:{ch:`c$x+65;ch,((0|x+x-1)#" "),(x>0)#ch}
{pad:(ci-x)#" ";pad,diam[x],pad}'(!ci+1),|!ci
\\
@oliwer
oliwer / sysexits.sh
Created February 7, 2019 10:53
/usr/include/sysexits.sh
# SYSEXITS.SH -- Exit status codes for system programs.
#
# This include file attempts to categorize possible error
# exit statuses for system programs, notably delivermail
# and the Berkeley network.
#
# Error numbers begin at EX__BASE to reduce the possibility of
# clashing with other exit statuses that random programs may
# already return. The meaning of the codes is approximately
# as follows:
@oliwer
oliwer / like_pascal.h
Last active January 13, 2019 20:48
C like Algol
/*
* if ... then
* ...
* elif ... then
* ...
* else
* ...
* end
*/
#define if if(
@oliwer
oliwer / mandataires-auto.txt
Created December 25, 2018 11:16
Mandataires Auto
aramisauto.com
auto-ies.com
autojm.fr
autoplanet.fr
degrifcars.com
Elite-auto.fr
starterre.fr
sndiffusion.fr
@oliwer
oliwer / DeusExText.u.txt
Created October 16, 2017 19:44
Deus Ex notes, emails, etc.
<B>UNATCO HANDBOOK</B>
<P>
<JC>Welcome to UNATCO!
<P>
<B>Angel/0A</B>. If you are not Angel/0A or above, report immediately to your supervisor or face disciplinary action. Other classifications will be explained upon reaching higher clearance.
<P>
<P>In its efforts to combat terrorism, the U.N. has created UNATCO for the swift deployment of a COORDINATED FORCE to counteract any insurgent operations. You are justifiably proud to be part of this organization: your physical capabilities place you within the upper one percent of national ground combat units, while your mental capabilities have been honed to sharpness by the UNATCO Academy.
<P>
<P>But as part of a larger organization, you also understand the necessity to HEED ORDERS from your superiors without hesitation; your superiors are typically briefed on matters for which you may not be cleared, and hesitation on the part of an agent can result in the serious IMPAIRMENT of mission objectives and attendant CASUALTIES.
<P>
@oliwer
oliwer / stat-date.pl
Created March 29, 2016 12:35
Mini-implémentation de stat en perl
#!/usr/bin/env perl
#
# Retourne la date de dernière modifications d'un fichier
# sous forme de timestamp.
#
use strict;
use warnings;
@oliwer
oliwer / SCK.pm
Last active March 26, 2016 00:51
WWW::Shorten::SCK
package WWW::Shorten::SCK;
#
# URL shortening provider for http://sck.pm
#
use strict;
use warnings;
sub new { bless {} }
@oliwer
oliwer / mksh-ipc.txt
Created December 10, 2015 10:45
mksh IPC
<lynx> btw, in *ksh you do this: find "$@" -print0 |& while read -pd ''; do …
<igli> ah does that keep the while in fg?
<lynx> yes
<igli> sweet
<lynx> it's actually two lines
<lynx> you newline after find "$@" -print0 |&
<lynx> it's conceptually like &
<lynx> except stdio of find is connected to fd 'p'
<lynx> you can even do things like exec 3>&p
<igli> ah ok