Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
brahimmachkouri / nodejs.yml
Last active February 19, 2022 17:04
Ansible playbook to install nodejs 14
---
- name: ilovenode
hosts: dev
become: yes
gather_facts: no
tasks:
- name: Run the equivalent of "apt-get update" as a separate step
apt:
update_cache: yes
@brahimmachkouri
brahimmachkouri / inject-pubkey.sh
Last active September 3, 2023 14:53
Inject ssh public key into multipass vm
#!/bin/bash
if [ $# -eq 0 ]
then
echo "I need the instance name :"
multipass ls
exit
fi
INSTANCE_NAME=$1
multipass copy-files $INSTANCE_NAME:/home/ubuntu/.ssh/authorized_keys .
cat ~/.ssh/id_rsa.pub >> authorized_keys
@brahimmachkouri
brahimmachkouri / gen_autosigned_certificate.sh
Created February 14, 2022 13:30
Generate a self signed certificate without asking a passphrase for the private key
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 5000 -nodes
@brahimmachkouri
brahimmachkouri / install_node.sh
Created February 13, 2022 18:00
Node.js installation
#!/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 November 9, 2021 11:19 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

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
Last active August 18, 2023 08:25
Show actual dhcp leases
#!/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 December 31, 2022 20:53
Download uqload video with youtube-dl
#!/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 March 27, 2021 11:13
move files in subfolder to the current folder
find ./ -type f -name "*.xls" -print0 | xargs -0 -I {} mv {} ./
@brahimmachkouri
brahimmachkouri / install_tools.sh
Created October 27, 2020 17:04 — forked from allenyllee/install_tools.sh
mount vhdx in linux
#!/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 February 14, 2022 13:32
Get the lastest version number of FogProject (or any Github Project)
#!/bin/bash
githubproject="https://github.com/FOGProject/fogproject/releases/latest/"
url=$(curl -Ls -o /dev/null -w %{url_effective} $githubproject)
version=${url##*/}
echo $version