Skip to content

Instantly share code, notes, and snippets.

@jpetazzo
jpetazzo / README.md
Last active October 5, 2017 08:25
Paris travel tips

Hi,

If you go to Paris, here are some places I like. I tried to group them by area. Of course there are MANY places in Paris; but I listed those I like to visit when I go back to Paris.

Saint Michel

The "Saint Michel" area is just South of "Notre Dame" (the huge church on the small island in the middle of Paris). There is the famous "Saint Michel Fountain",

#!/bin/sh
SSID=$1
PSK=$2
nmcli con add con-name "w-$SSID" ifname wlan0 type wifi ssid "$SSID"
nmcli con mod "w-$SSID" wifi-sec.key-mgmt wpa-psk
nmcli con mod "w-$SSID" wifi-sec.psk "$2"
nmcli con up "w-$SSID"
@jpetazzo
jpetazzo / ansibull.png
Created August 27, 2015 22:53
Generate an ANSI bull.
ansibull.png
@jpetazzo
jpetazzo / README.md
Created January 9, 2015 17:06
Mouses Are Overrated!

Mouses Are Overrated

This script allows you to enable/disable your pointers on a Linux machine.

Usage:

mao.sh on   # enters "mouseless" mode
mao.sh off  # returns to "I can has clicks" mode

Note: if you just want to disable built-in pointers (to keep a mouse on the side

FROM ubuntu:14.04
RUN apt-get update -q
RUN apt-get install -qy chromium-chromedriver
RUN apt-get install -qy python3-pip
RUN apt-get install -qy xvfb
RUN apt-get install -qy x11vnc
RUN pip3 install IPython
RUN pip3 install selenium
RUN pip3 install PyYAML
RUN touch /credentials.yml
  1. Start container
  2. Create view.sh
  3. Create a FIFO with mkfifo /tmp/view
  4. Have a writer on the FIFO: just leave cat >/tmp/view running somewhere
  5. Run socat TCP-LISTEN:8080,reuseaddr,fork EXEC:/path/to/view.sh
  6. Whenever you want to kick everybody out, you can kill socat or kill the cat process :-)
#!/bin/sh
exec docker run -t \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /:/hostfs -w /hostfs/$(pwd) \
fig fig "$@"
@jpetazzo
jpetazzo / README.md
Created August 4, 2014 16:48
BASE27 encoding

Base 27 encoding

This is just for lulz.

  • Take a character string (ASCII8, no character >242).
  • Transform each byte into a sequence of 5 trinary digits (i.e. from 00000 to 22222).
  • Concatenate all trinary digits (i.e. a long sequence of 0, 1, and 2).
  • Add extra 0s at the end so that the total length is divisible by 3.
  • Break down by groups of 3.
  • Transform each group of 3 into an integer, ranging from 0 to 26.
FROM ubuntu
ADD run.sh /
CMD bash
@jpetazzo
jpetazzo / README.md
Created July 3, 2014 12:14
Shared Mounts Experiment