Skip to content

Instantly share code, notes, and snippets.

View swyngaard's full-sized avatar
🌍
Hello!

Sebastian Wyngaard swyngaard

🌍
Hello!
View GitHub Profile
@swyngaard
swyngaard / readme
Created February 21, 2017 07:27
Install sudo on Debian
Install sudo package as root:
# apt-get install sudo
Add a user to sudo group as root:
# usermod -a -G sudo username
Log the user (username) out of the current session and back in again. Test that it works:
$ sudo test
Ignore the warning message. If successfully completed no output will be generated and you should be returned to the terminal prompt as usual.
@swyngaard
swyngaard / local.conf
Last active February 26, 2017 16:24
Setup Debian Testing release with fallback to Unstable release
APT::Default-Release "testing";
@swyngaard
swyngaard / get_ip.sh
Last active February 21, 2017 14:55
Docker get IP address of running container
#!/bin/bash
docker inspect $1 | jq -r '.[].NetworkSettings.IPAddress'
@swyngaard
swyngaard / readme
Last active February 23, 2017 09:21
Install Docker on Debian
Install docker:
$ sudo aptitude install docker.io
Add user to docker group to avoid using sudo:
$ sudo usermod -a -G docker $USER
Logout and back in again to enable the new group for the user.
References:
https://docs.docker.com/installation/debian/
@swyngaard
swyngaard / readme
Last active November 23, 2023 11:41
FFMPEG record desktop at 60 frames per second
Install ffmpeg or libav-tools.
Change -video_size to match your desktop resolution.
Record your desktop by executing the script:
./record.sh
Record without audio as follows:
./record_no_audio.sh
@swyngaard
swyngaard / readme
Last active February 21, 2017 09:17
Add an EXT4 formatted harddrive to /etc/fstab on Debian
Find the UUID of the partition by running the following command:
$ sudo blkid
Create the mount point under /media as follows:
$ sudo mkdir /media/backup
Add the following line to /etc/fstab to mount the ext4 partition on boot:
UUID=fb72eb53-a418-4152-b63e-d16256e81134 /media/backup ext4 defaults,user 0 0
@swyngaard
swyngaard / hide_ntfs_partition.md
Last active October 16, 2017 16:45
Hide unused Windows partitions when under Linux

Find the UUID of the paritions by running the following command:

sudo blkid

Output from the above command will look similar to the following:

/dev/nvme0n1p1: LABEL="SYSTEM" UUID="9403-16A5" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="02ea9cd5-3978-4c4f-a4ea-b51d9c7ffc37"
/dev/nvme0n1p3: LABEL="Windows" UUID="FC82088E82084F96" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="d66e2825-09c8-4c99-b529-77068113c88c"
/dev/nvme0n1p4: LABEL="WinRE_DRV" UUID="A6E808F4E808C491" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="fd5ff108-9a06-4a2a-a7f4-e74e583a0f3c"
/dev/nvme0n1p5: UUID="1801f4f8-7d90-4d70-b3a3-5d4344a22d6a" TYPE="ext4" PARTUUID="98df8734-8cd9-40db-9300-cba481198c42"
@swyngaard
swyngaard / readme
Created February 21, 2017 09:23
Add a NTFS formatted harddrive to /etc/fstab on Debian
Find the UUID of the partition by running the following command:
$ sudo blkid
Create the mount point under /media as follows:
$ sudo mkdir /media/scratch
Add the following line to /etc/fstab to mount the ntfs partition on boot:
UUID=60C469A9C46981E0 /media/scratch ntfs-3g auto,user,exec,permissions,windows_names 0 0
@swyngaard
swyngaard / readme
Last active February 21, 2017 13:24
Allow user to start unprivileged LXC containers from the current bash session in Debian
Enable the ability to start containers in the current shell session:
./start.sh
Alternatively, execute the following set of commands:
$ sudo cgm create all $USER
$ sudo cgm chown all $USER $(id -u $USER) $(id -g $USER)
$ cgm movepid all $USER $$
@swyngaard
swyngaard / readme
Created February 21, 2017 13:49
Join specific pages of multiple PDF files into one PDF using pdftk
Install pdftk:
sudo aptitude install pdftk
Concatenate the 1st page of a.pdf with the 2nd and 3rd pages of b.pdf to produce c.pdf:
pdftk A=a.pdf B=b.pdf cat A1 B2-3 output c.pdf