Skip to content

Instantly share code, notes, and snippets.

View bricewge's full-sized avatar

Brice Waegeneire bricewge

View GitHub Profile
@bricewge
bricewge / icecat-tor.sh
Created June 3, 2020 13:34
Start IceCat proxying trough Tor
profile=/tmp/profile
mkdir "$profile" && cat <<EOF > "$profile"/prefs.js
user_pref("browser.startup.homepage", "https://check.torproject.org/");
user_pref("network.proxy.socks", "localhost");
user_pref("network.proxy.socks_port", 9050);
user_pref("network.proxy.type", 1);
EOF
icecat --safe-mode --profile "$profile"
@bricewge
bricewge / herolte.org
Last active October 4, 2020 17:09
Customizations for Android

Customizations for herolte

Disable hardware keys

If you have root enabled on your device just do the following to remount the /system as read and write.

adb root
adb remount
@bricewge
bricewge / Org.sublime-syntax
Created May 25, 2019 18:02
Syntax for org-mode in .sublime-syntax format
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: orgmode
file_extensions:
- org
scope: text.orgmode
contexts:
main:
- match: |-
@bricewge
bricewge / Caddyfile
Created February 23, 2019 10:41
Deploying hugo blog with caddy
localhost:8080 {
root ./my-site
internal .repo
git {
repo https://github.com/kaushalmodi/hugo-bare-min-theme.git
path .repo
clone_args --depth 1 --recurse-submodules
pull_args --recurse-submodules
interval 3600
then hugo --source ./exampleSite --destination ../..
@bricewge
bricewge / ble-button.py
Last active December 18, 2023 18:12
Use iTag Bluetooth BLE tracker as a light switch with Home Assistant
from bluepy import btle
import requests
bleAddr = "ff:ff:10:05:ef:ff"
url = "http://localhost:8123/api/services/light/toggle"
lamp = "light.mylight"
hassPasswd = "password"
class LightToggleDelegate(btle.DefaultDelegate):
def __init__(self):
@bricewge
bricewge / recover-nix.sh
Last active September 27, 2017 13:18
Recover nixos install on Kimsufi
#!/usr/bin/env sh
# TODO Make the script fully ineractive
# TODO Use [Kimsufi's API](https://eu.api.kimsufi.com/) to do the current manual stuff
# Recover a NixOS install on Kimsufi servers by roll-back
# 1. On the Kimsufi dashboard change your boot to rescue (Netboot -> Rescue -> rescue64-pro -> Next -> Confirm)
# 2. Restart your server, ideally a soft reboot, otherwise do it from the dashboard
# 3. Connect to your server as root by SSH and run this script
# 4. Revert your boot option back to your HDD and restart your server
@bricewge
bricewge / corec_d04.sh
Created June 26, 2017 12:08
piscine_php
#!/usr/bin/env sh
export PS4='\e[37m❯ \e[0m'
host=`hostname`
port="8080"
echo "\n==== ex00 ====\n"
set -o xtrace
curl -v -c cook.txt "http://$host:$port/j04/ex00/index.php"
curl -v -b cook.txt "http://$host:$port/j04/ex00/index.php?login=sb&passwd=beeone&submit=OK"
@bricewge
bricewge / ft_ls-test.sh
Last active January 10, 2019 19:32
ft_ls test
diff -u <(LC_ALL=C ls -lR /usr/bin) <(LC_ALL=C ./ft_ls -lR /usr/bin)
touch -t 999912312459 future ls -lt
ls -l ~/ ''
ls - auteur
ls ////dev///urandom
ls -j ./
ls -- -j ./
ls INVALID Makefile TROLOLOL
ls -aR /Library/Scripts/42/munki
ls -lt /dev
@bricewge
bricewge / 11.fillit
Created January 17, 2017 14:33
fillit tests
..#.
..#.
..#.
..#.
....
.##.
.#..
.#..
@bricewge
bricewge / Slic3r_config_bundle.ini
Created October 15, 2016 07:24
Slic3r_config_bundle.ini
# generated by Slic3r 1.2.9 on Sat Oct 15 09:22:30 2016
[filament:PETG]
bed_temperature = 50
bridge_fan_speed = 100
cooling = 0
disable_fan_first_layers = 3
extrusion_multiplier = 1
fan_always_on = 0
fan_below_layer_time = 60