Skip to content

Instantly share code, notes, and snippets.

Avatar

Brahim Machkouri brahimmachkouri

View GitHub Profile
@brahimmachkouri
brahimmachkouri / inject-pubkey.sh
Last active Oct 18, 2022
Inject ssh public key into multipass vm
View inject-pubkey.sh
#!/bin/bash
if [ $# -eq 0 ]
then
echo "I need the instance name."
exit
fi
INSTANCE_NAME=$1
multipass copy-files $INSTANCE_NAME:/home/ubuntu/.ssh/authorized_keys .
cat ~/.ssh/id_rsa.pub >> authorized_keys
multipass copy-files authorized_keys $INSTANCE_NAME:/home/ubuntu/.ssh/authorized_keys
@brahimmachkouri
brahimmachkouri / gen_autosigned_certificate.sh
Created Feb 14, 2022
Generate a self signed certificate without asking a passphrase for the private key
View gen_autosigned_certificate.sh
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 5000 -nodes
View install_node.sh
#!/bin/bash
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs
@brahimmachkouri
brahimmachkouri / gist:530b67f38f39fba52c8309abbaf080fa
Created Nov 9, 2021 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:530b67f38f39fba52c8309abbaf080fa

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@brahimmachkouri
brahimmachkouri / show_leases.py
Created Aug 31, 2021
Show actual dhcp leases
View show_leases.py
#!/usr/bin/python
import datetime, bisect
def parse_timestamp(raw_str):
tokens = raw_str.split()
if len(tokens) == 1:
if tokens[0].lower() == 'never':
return 'never';
@brahimmachkouri
brahimmachkouri / uqload.sh
Last active Aug 29, 2021
Download uqload video with youtube-dl
View uqload.sh
#!/bin/bash
# usage : uqload.sh "direct_url"
youtube-dl --referer "https://uqload.com" --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0" $1
@brahimmachkouri
brahimmachkouri / move_files.sh
Last active Mar 27, 2021
move files in subfolder to the current folder
View move_files.sh
find ./ -type f -name "*.xls" -print0 | xargs -0 -I {} mv {} ./
View install_tools.sh
#!/bin/bash
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client
@brahimmachkouri
brahimmachkouri / fog-latest.sh
Last active Feb 14, 2022
Get the lastest version number of FogProject (or any Github Project)
View fog-latest.sh
#!/bin/bash
githubproject="https://github.com/FOGProject/fogproject/releases/latest/"
url=$(curl -Ls -o /dev/null -w %{url_effective} $githubproject)
version=${url##*/}
echo $version
View bureau_a_distance.rdp
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1680
desktopheight:i:1050
session bpp:i:32
winposstr:s:0,1,880,107,1680,707
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1