Skip to content

Instantly share code, notes, and snippets.

Avatar

Silviu Vulcan filviu

View GitHub Profile
@filviu
filviu / gist:5ba69474cfbd31c7d20d339bf3a983a9
Created March 31, 2023 05:31
Multiple 9p folder mounts with proxmox
View gist:5ba69474cfbd31c7d20d339bf3a983a9
In `/etc/pve/qemu-server/NNN.conf`
```
args: -fsdev local,security_model=passthrough,id=fsdev0,path=/some/path/folder1 -device virtio-9p-pci,id=fs0,fsdev=fsdev0,addr=0x4,mount_tag=9p_folder1 -fsdev local,security_model=passthrough,id=fsdev1,path=/some/path/folder2 -device virtio-9p-pci,id=fs1,fsdev=fsdev1,addr=0x1a,mount_tag=folder2
```
Then inside the VM inside `/etc/fstab`
```
folder1 /mnt/folder1 9p trans=virtio,rw,_netdev,nobootwait 0 0
@filviu
filviu / .bashrc-bookmarks
Last active March 31, 2023 05:17
Shell bookmarks in bash
View .bashrc-bookmarks
#!/bin/bash
if [ -d "$HOME/.bookmarks" ]; then
export CDPATH=".:$HOME/.bookmarks:/"
alias {g,go,goto}="cd -P"
_goto()
{
local IFS=$'\n'
COMPREPLY=( $( compgen -W "$(/bin/ls ~/.bookmarks)" -- ${COMP_WORDS[COMP_CWORD]}))
} && complete -F _goto goto go g
@filviu
filviu / cloud-init.cfg
Created March 14, 2023 13:07 — forked from berkant/cloud-init.cfg
Cloud-init config to set up my Ubuntu dev machine.
View cloud-init.cfg
## template: jinja
#cloud-config
{% if v1.distro_release == 'focal' %}
users:
- name: berkant
shell: /usr/bin/bash
ssh_import_id: gh:berkant
sudo: ALL=(ALL:ALL) NOPASSWD:ALL
@filviu
filviu / openssl-notes.txt
Created January 28, 2022 11:16 — forked from tsaarni/openssl-notes.txt
Generate self-signed certs with different key types
View openssl-notes.txt
*** RSA
# Generate self-signed certificate with RSA 4096 key-pair
openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout rsakey.pem -out rsacert.pem
# print private and public key
openssl rsa -in rsakey.pem -text -noout
# print certificate
openssl x509 -in rsacert.pem -text -noout
@filviu
filviu / ps.sh
Created November 2, 2021 11:49
Process uptime
View ps.sh
ps -eo comm,etime,user | grep PROCESS
@filviu
filviu / Microsoft.PowerShell_profile.ps1
Last active November 2, 2021 11:50
Powershell CTRL+D to exit terminal.
View Microsoft.PowerShell_profile.ps1
# drop in Documents\WindowsPowerShell
# Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Set-PSReadlineKeyHandler -Key ctrl+d -Function ViExit
@filviu
filviu / n800-video.sh
Created November 2, 2021 11:15
Options for mplayer on Nokia N800 to get decent playback. Last time checked ~2012
View n800-video.sh
mplayer -lavdopts lowres=1 <videofile>
mplayer quiet-file -af volume=10
@filviu
filviu / .bashrc.local
Created October 29, 2021 09:38
SSH_AUTH_SOCK with remote desktop and vscode
View .bashrc.local
# make sure your .bashrc actually loads a .bashrc.local
if [ "$TERM_PROGRAM" != "vscode" ]; then
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
fi
@filviu
filviu / get-hugo.sh
Created October 11, 2021 09:22
Install hugo binary
View get-hugo.sh
#!/bin/bash
tempdir=$(mktemp -d)
cd $tempdir
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "browser_download_url.*Linux-64bit.tar.gz"|grep -v extended | cut -d : -f 2,3 | tr -d \" | wget -qi -
tar -xf $(ls -1 *.tar.gz)
mv hugo ~/bin/
cd -
rm -rf $tempdir
@filviu
filviu / update-rclone.sh
Created October 11, 2021 09:18
Update rclone to latest amd64 version.
View update-rclone.sh
#!/bin/bash
CURDIR="$(pwd)"
TMPDIR="$(mktemp -d)"
cd $TMPDIR
wget https://downloads.rclone.org/rclone-current-linux-amd64.deb
dpkg -i rclone-current-linux-amd64.deb
cd "${CURDIR}"
rm -rf "${TMPDIR}"