Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile

Arch Linux btrfs install

0. Prerequisites

  1. Latest Arch Linux install iso because those have newer kernels and more bugfixes in btrfs.
  2. Have previous experience with installing Arch (like you can install arch with a blind fold).

1. Parititions

We will ne two of them, one for /boot and the other one will be a btrfs partition with subvolumes.

  1. /dev/sda1 - this will be /boot with vfat filesystem because UEFI or syslinux for legacy BIOS boot
@artizirk
artizirk / hax.py
Created September 10, 2015 07:43
CodeClub: Python - 2. September
#!/usr/bin/env python3
fast_code = r"""
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
//#define MAX 10000
@artizirk
artizirk / main.py
Created September 10, 2015 07:48
CodeClub: Python - 9. September
#!/usr/bin/env python3
# This is a simple 4 banger calculator
LICENSE = """DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2015 Arti Zirk <arti.zirk@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
@artizirk
artizirk / kkv1.md
Last active September 10, 2015 08:32
IT sotsiaalsed, eetilised ja professionaalsed aspektid - Praktikum 1 - http://enos.itcollege.ee/~kaido/v1/ lehel olevate küsimuste vastused
  1. Ühe levinud arvutitüübi üks mudel sai oma nime looja tütre eesnime järgi. Mis nimi see oli ja kes oli tüdruku isa?

    Arvuti nimi oli Lisa ja arvuti looja oli Steve Jobs source

  2. Püha Isidorus Sevillast oli VI-VII sajandil elanud hispaania õpetlane ja piiskop. Mis seos on tal aga IT-ga?

¿ source

@artizirk
artizirk / 01-video.py
Last active November 22, 2022 11:48
Python v4l2 webcam capture test using PlayStation 3 camera. More advanced script can be found here: https://github.com/eik-robo/zoidberg/blob/master/examples/purepy_video_capture.py
#!/usr/bin/env python3
from v4l2 import *
import fcntl
import mmap
import select
import time
vd = open('/dev/video0', 'rb+', buffering=0)
@artizirk
artizirk / wpa_supplicant.py
Created April 3, 2016 21:45
A small example of connecting to wpa_supplicant daemon control socket that is also used by wpa_cli with python
import os
import select
import socket
interface = "wlan1"
wpa_send_path = "/run/wpa_supplicant/"+interface
wpa_recv_path = "/tmp/wpa_ctrl_{pid}-{count}".format(pid=os.getpid(), count=1)
soc = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM, 0)
soc.bind(wpa_recv_path)
@artizirk
artizirk / objs.js
Created April 22, 2016 22:16
javascript prototype objects test
function Obj() {
console.log("obj init");
this.bs();
}
Obj.prototype.bs = function() {
console.log("this is bs");
};
var obj = new Obj();
#!/usr/bin/bash -e
BASE="/var/lib/machines"
LANG="C.UTF-8"
PKGS=(
filesystem
bash
bash-completion
glibc
@artizirk
artizirk / kbm_sleep.sh
Created August 4, 2016 23:37
Puts my keyboard and mouse to sleep, ie turns off the leds when the screen goes to sleep
#!/bin/bash
old_dpms=""
while true; do
dpms=$(xset -q|grep Monitor|awk '{print $3;}')
if [ "$dpms" != "$old_dpms" ]; then
old_dpms=$dpms
if [ "$dpms" == "Off" ]; then
echo "Puting keyboard and mouse to sleep"
echo auto | sudo tee /sys/bus/usb/devices/3-13/power/control
echo auto | sudo tee /sys/bus/usb/devices/3-14/power/control
@artizirk
artizirk / archlinux-mirror.py
Created August 12, 2016 01:26
This python script generates a file list for aria2 for downloading all the packages from all the repos using all the available mirrors
#!/usr/bin/python3
import os
import shutil
import tempfile
import subprocess
from pprint import pprint
from Reflector import MirrorStatus
ms = MirrorStatus()