Skip to content

Instantly share code, notes, and snippets.

@microft
microft / gist:9c2c5343b95459a41dc4
Last active March 31, 2024 16:06
vbox vagrant mount fix
[default] -- /vagrant
Failed to mount folders in Linux guest. This is usually beacuse
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` /vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant
@microft
microft / .zshrc
Last active March 31, 2024 21:19
zsh functions to create and use python 3 virtualenvs based on the directory name
WORKON_HOME=/home/microft/.virtualenvs
workon(){
cd $1;
source $WORKON_HOME/${PWD##*/}/bin/activate
return 0;
}
mkvenv(){
python3 -m venv $WORKON_HOME/$1
}
@microft
microft / .zshrc
Created April 3, 2024 17:27
Usefull shell commands
alias webserver="python3 -m http.server"
alias tunnel="ssh -v -D 1337 -C -N"
import json
import sys
import boto3
def create_empty_file(bucket_name, key):
s3 = boto3.client('s3')
s3.put_object(Bucket=bucket_name, Key=key, Body=b'')
def revert_to_previous_version(bucket_name, key):