Skip to content

Instantly share code, notes, and snippets.

import json
from operator import attrgetter
import pyalpm
handle = pyalpm.Handle("/", "/var/lib/pacman")
db = handle.get_localdb()
getpkgdata = attrgetter("name", "version")
#!/bin/bash
WINDOW_SIZE="2560x1440"
CWD="$*"
Xephyr -br -ac -noreset -screen $WINDOW_SIZE :9 &
DISPLAY=:9 xfwm4 &
sleep 1
DISPLAY=:9 lxpanel &
DISPLAY=:9 pcmanfm --desktop &
make[3]: Entering directory '/home/user/Downloads/transmission3-cli/src/transmission-3.00/gtk'
CC details.o
details.c: In function ‘on_edit_trackers’:
details.c:2604:9: warning: ‘GtkStock’ is deprecated [-Wdeprecated-declarations]
2604 | d = gtk_dialog_new_with_buttons(gstr->str, win, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
| ^
details.c:2605:13: warning: ‘GtkStock’ is deprecated [-Wdeprecated-declarations]
2605 | GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
| ^~~~~~~~~~~~~~~~~~~
details.c: In function ‘on_tracker_list_add_button_clicked’:
import csv
import sys
def print_dict_as_csv(dict_data):
if not dict_data:
print("The dictionary is empty.")
return
# Get the fieldnames from the keys of the first dictionary
fieldnames = dict_data[0].keys()
[ 54%] Built target aom_dsp_common
[ 64%] Built target aom_av1_common
[ 64%] Built target aom_dsp_encoder_ssse3
[ 83%] Built target aom_av1_encoder
[ 83%] Built target aom_mem
[ 85%] Built target aom_dsp_encoder_ssse3_intrinsics
[ 86%] Built target aom_util
[ 87%] Built target aom_av1_encoder_sse42_intrinsics
[ 87%] Built target aom_dsp
[ 87%] Built target aom_av1_encoder_ssse3
@radupotop
radupotop / robots.txt
Created December 10, 2023 20:40
Disallow GPTBot in robots.txt
User-agent: *
Disallow: /action
Disallow: /help
Disallow: /search
Allow: /action/showJournal
Allow: /action/showPublications
User-agent: facebookexternalhit
User-agent: LinkedInBot
User-agent: Twitterbot
from dataclasses import dataclass
from typing import Tuple, Type, Dict
VertexType = Type['Vertex']
@dataclass
class Vertex:
name: str
value: int
@radupotop
radupotop / gocryptmount.sh
Created July 21, 2023 11:03
A basic Gocryptfs mount helper.
#!/bin/bash
#
# A basic Gocryptfs mount helper.
MOUNT_NAME=$(realpath "$1")
BASE_NAME=$(basename "$MOUNT_NAME")
MOUNT_DIR="$HOME/mnt/$BASE_NAME"
logger "Mounting $MOUNT_NAME to $MOUNT_DIR"
from Crypto.PublicKey import RSA
from Crypto.Signature.pkcs1_15 import PKCS115_SigScheme
from Crypto.Hash import SHA256
import binascii
# Generate 1024-bit RSA key pair (private + public key)
keyPair = RSA.generate(bits=1024)
pubKey = keyPair.publickey()
# Sign the message using the PKCS#1 v1.5 signature scheme (RSASP1)
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.