Skip to content

Instantly share code, notes, and snippets.

@fjctp
fjctp / web-servers.md
Created May 12, 2024 23:56 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@fjctp
fjctp / qemu_start.bash
Last active October 24, 2021 19:04
Using virt-install to create a virtual machine
#!/bin/bash
#
# based on https://gist.github.com/Manouchehri/2b1b523eed834f295915
set -e
ISO_FILE=~/Downloads/archlinux-2021.10.01-x86_64.iso
DISK_FILE=archlinux.qcow2
if [[ ! -f ${ISO_FILE} ]]; then
@fjctp
fjctp / README.md
Last active June 13, 2021 16:38
Acer Switch Alpha 12

Wiki for Acer Switch Alpha 12

Boot to BIOS

Press and hold F2 during boot

Select Boot Device

Press F12 during boot

@fjctp
fjctp / README.md
Last active June 13, 2021 16:32
OpenSUSE EFI file for Secure Boot

Secure Boot

By default

/EFI/BOOT/bootx64.efi as the extension that will load and execute in order to load the operative system.
In Windows machines, the correct extension is in /EFI/Microsoft/Boot/BCD.efi
for openSUSE is /EFI/opensuse/grubx64.efi (or shim.efi if we have secure boot enabled)
@fjctp
fjctp / download.py
Last active April 27, 2021 05:51
Download all URLs in humblebundle's order page
#!/usr/bin/python3
import argparse
import json
import subprocess
parser = argparse.ArgumentParser(description='Download from humblebundle')
parser.add_argument('filename', help='.json')
args = parser.parse_args()
filename = args.filename
@fjctp
fjctp / ubuntu-server-20.04-sense-hat.md
Last active November 1, 2020 16:44
Using sense hat in Ubuntu Sever 20.04
  1. Ensures that the Industial I/O Core module is not loaded.

The modules blacklisted here takes over the pressure and magnetic sensors of the Sense HAT device which prevents other applications from using those sensors.

Create the file /etc/modprobe.d/blacklist-industialio.conf with the following contents:

blacklist st_magn_spi
blacklist st_pressure_spi
blacklist st_sensors_spi
@fjctp
fjctp / README.md
Last active February 13, 2024 01:18
RPi Zero W kiosk

Summary

Setup RPi Zero W as a kiosk

Step

  1. write Raspbian Lite image to a SD card
  2. enable ssh
touch /boot/ssh
  1. setup WiFi
@fjctp
fjctp / README.md
Last active March 14, 2020 22:41
Loop device in Linux

Loop Devices

Loop devices are how entire file systems can be mounted. If you have had any experience with most virtualization (eg KVM, Virtualbox, VMware, etc) the most common way Guests store data is in a file (aka virtual disk) which can contain an entire operating system or more on a specified file system. The "virtual disk" file with its contents is mounted for use by the Guest and generally protected from other access.

In the same way, it might be useful to mount an ISO file for access without burning the file's contents to an optical disk (CD or DVD typically).

There are other scenarios where it's useful to mount file systems so that they are accessible from the currently running system.

The file containing the file system that attached to a loop device is typically called a backing file.

@fjctp
fjctp / docker-compose.yaml
Last active September 23, 2019 23:48
docker volume nfs4
volumes:
example_vol:
driver_opts:
type: "nfs4"
o: "addr=SERVER_IP,nolock,hard,rw"
device: ":/path/to/dir"
@fjctp
fjctp / README.md
Last active February 20, 2019 04:37
Build ROS 2 crystal for raspberry pi