Skip to content

Instantly share code, notes, and snippets.

Avatar

Silviu Vulcan silviuvulcan

View GitHub Profile
View vob2mkv.sh
#!/bin/bash
# concatenate
cat *.VOB > output.vob
# find streams
ffmpeg -i output.vob
# find missing subs
ffmpeg -analyzeduration 100M -probesize 100M -i output.vob
@silviuvulcan
silviuvulcan / update-hcloud.sh
Created Jul 19, 2021
Update the hcloud cli binary to the latest version
View update-hcloud.sh
#!/bin/bash
hcloud version
temp_dir=$(mktemp -d)
cd $temp_dir
wget https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz
tar -xf hcloud-linux-amd64.tar.gz
mv hcloud ~/bin/
cd -
rm -rf $temp_dir
hcloud version
@silviuvulcan
silviuvulcan / 01-autologin.conf
Created Jan 15, 2021
Lightdm autologin without modifying lightdm.conf. Add in /etc/lightdm/lightdm.conf.d
View 01-autologin.conf
[Seat:*]
autologin-user=USER
autologin-timeout=0
@silviuvulcan
silviuvulcan / README.md
Created Oct 8, 2020
pfsense haproxy basic auth
View README.md

Services / HAProxy / Settings

Global Advanced pass thru

userlist AUTHREALMNAME user USERNAME insecure-password PASSWORD

Services / HAProxy / Frontend

Access Control lists

@silviuvulcan
silviuvulcan / gist:b90942bea74fe64c4a8d08231fea4591
Created Sep 22, 2020 — forked from trongthanh/gist:2779392
How to move a folder from one repo to another and keep its commit history
View gist:b90942bea74fe64c4a8d08231fea4591
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@silviuvulcan
silviuvulcan / README.md
Last active Jun 9, 2020
Basic auth with pfSense and haproxy
View README.md

If you want to add a basic auth to haproxy (on pfsense)

haproxy general settings

Global Advanced pass thru

userlist AuthRealmName
  user username password ENCRYPTED_PASSWORD_HERE
@silviuvulcan
silviuvulcan / README.md
Last active Sep 19, 2021 — forked from jpmens/github-mirror.py
Stefan expands on https://jpmens.net/2019/04/15/i-mirror-my-github-repositories-to-gitea/ I'm expanding on his work to mirror gists and starred repos and gists as well. I'm grouping those three in 4 different gitea organizations
View nfs_mount.yml
# First define your dict:
nfsmounts:
- { path: "/mnt/nfs_mount", src: "192.168.0.55:/nfsshare" }
- { path: "/mnt/nfs_mount_2", src: "192.168.0.55:/nfsshare_2" }
# Shamelessly lifted from here:
# https://stackoverflow.com/questions/45387791/mount-different-shares-from-nfs-on-a-linux-os-using-ansible
# Then loop through it:
- name: mount the nfsshare in client side
View branch_fallback_Jenkinsfile
# checkout a repository with branch fallback
repos.split(',').each {
echo "Checking out ${it}"
dir("${it}"){
checkout resolveScm(
source: [
$class: 'GitSCMSource',
credentialsId: '51234-5678-9101-2131',
id: '_',
remote: "git@github.com:somebody/${it}.git",
@silviuvulcan
silviuvulcan / README.md
Last active Dec 8, 2020
Mount 9p virtio inside VM
View README.md

Mount a host folder inside a VM using 9p virtio

/etc/initramfs-tools/modules

# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax:  module_name [args ...]
#