Skip to content

Instantly share code, notes, and snippets.

View vincentbernat's full-sized avatar

Vincent Bernat vincentbernat

View GitHub Profile

Encrypted root in VM

#+filetags :exoscale:

The goal is to switch a VM to an encrypted root. There are several challenges:

  • add a /boot partition
  • convert the root partition to an encrypted one
  • boot the VM with the encrypted root

Preliminary steps

@vincentbernat
vincentbernat / redundancy
Last active October 30, 2016 05:53
Network model using Prolog
% -*- prolog -*-
%% Constants
nb_aggrs(2). % Number of aggregation switches.
nb_racks(3). % Number of racks.
nb_hosts(4). % Number of hosts per racks
nb_tors(2). % Number of ToR swtches.
%% Hard coded failures.
% aggr(1) :- !, fail.
rfkill unblock wwan
sleep 1
#sudo systemctl stop NetworkManager
sudo systemctl stop ModemManager
sudo modprobe -r cdc_mbim
rfkill block wwan
sudo =usbreset $(lsusb -d 1199: | awk -F '[: ]' '{print "/dev/bus/usb/"$2"/"$4}')
sleep 1
sudo modprobe cdc_mbim
#sudo systemctl start ModemManager
rfkill block bluetooth
sudo service bluetooth stop
sudo modprobe -r btusb
sleep 1
sudo modprobe btusb
sleep 1
rfkill unblock bluetooth
sleep 1
sudo service bluetooth start
sleep 1
global closed_trace%
global closed_timestamp%
global closed_tid%
probe syscall.close {
if (target() != pid()) {
next
}
closed_trace[$fd] = ubacktrace()
closed_timestamp[$fd] = gettimeofday_us()
#!/bin/sh
set -xe
mkdir zones
cd zones
git init
git checkout -b staging
for i in $(seq 1 20); do
echo $i >> f1

pytest all the things

@vincentbernat
vincentbernat / review.md
Created May 6, 2016 19:22
Quick review of the OnePlus X

From an hardware point of view, this is somewhat an evolution of the Nexus 5. Same size, same processor family (just a more modern variant), a little bit more of memory, no 802.11a, no NFC. The casing is quite beautiful and it comes with a good-looking USB cable and many protection layers (for the screen and for the back). It's a bit expensive considering it only matches the hardware of a Nexus 5. But maybe the AMOLED screen and the back in glass are more expensive. Also, great AMOLED screen.

And it's double SIM (dual standby, one radio but any SIM can receive calls and SMS when standby, only one sim can use 3G/4G, but it's possible to switch from one SIM to another; almost impact on battery). Good battery live (better than my previous Nexus 5 when it was new).

From a software point of view, this is quite different. The OnePlus One was running CyanogenMod and this is not the case for the OnePlus X. You get OxygenOS, a proprietary derivation of AOSP. It's almost pure AOSP. Most of the small differences are o

#!/bin/sh
export LC_NUMERIC=en_US.utf8
factor=$(echo $(xrdb -query | sed -n 's/^Xft.dpi:\t\([0-9]*\)$/\1/p')/96 | bc -l)
exec /usr/bin/spotify --force-device-scale-factor=$factor --ignore-gpu-blacklist "$@"
#!/bin/sh
export LC_NUMERIC=en_US.utf8
factor=$(echo $(xrdb -query | sed -n 's/^Xft.dpi:\t\([0-9]*\)$/\1/p')/96 | bc -l)
for l in ~/.mozilla/firefox/*.default*; do
echo "user_pref('layout.css.devPixelsPerPx', '${factor}');" > $l/user.js
done
exec /usr/bin/firefox "$@"