Skip to content

Instantly share code, notes, and snippets.

@thijsvos
thijsvos / rootless_docker.md
Last active March 11, 2022 15:41
Install rootless Docker and fix UFW+Docker

First run the following command.

cat <<EOF | sudo sh -x
apt-get install -y uidmap
EOF

Get rootless Docker and install.

curl -sSL https://get.docker.com/rootless | sh
@nileshtrivedi
nileshtrivedi / home-server.md
Last active June 1, 2024 00:11
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

@dimasahmad
dimasahmad / Caddyfile
Last active July 22, 2022 05:15
Install Caddy 2 on Ubuntu
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
:80
reverse_proxy 10.100.100.1:80
@anantshri
anantshri / gnome_shell_extensions.md
Last active May 26, 2020 21:25
MY experiments with various Gnome Shell extensions and tweaks that i had to apply

Introduction

I have come back for the first time to Gnome after they moved to version 3. This environment is very new for me and hence a lot of my experiments are around fixing things which i feel are wrong.

I have realized that they want a certain experiance and then they allow extensions to customize that experiance as per users needs.

I have applied a whole bunch of extensions as per my need to get things working for myself.

list of extensions

@shyba
shyba / pomodoro.py
Created August 6, 2018 19:07
quick pomodoro with libnotify and python
# sudo apt install libnotify-bin libnotify-dev python-gobject
# python pomodoro.py "do homework"
import sys
from time import sleep
from gi.repository import Notify
Notify.init("App Name")
Notify.Notification.new(sys.argv[-1]).show()
Notify.Notification.new("Pomodoro Start!").show()
for i in range(25):
@lyoshenka
lyoshenka / tx.go
Created September 4, 2017 20:59
A simple, neat way to wrap code in an sql transaction with proper committing/rollbacking and error handling.
// TxFunc is a function that can be wrapped in a transaction
type TxFunc func(tx *sql.Tx) error
// WithTx wraps a function in an sql transaction. After the function returns, the transaction is
// committed if there's no error, or rolled back if there is one.
func WithTx(db *sql.DB, f TxFunc) (err error) {
tx, err := db.Begin()
if err != nil {
return err
}
@subfuzion
subfuzion / dep.md
Last active July 25, 2024 03:38
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@jarun
jarun / chrome_extensions.md
Last active July 13, 2024 00:23
A collection of useful Google Chrome extensions