This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ll='ls -laFhGH' | |
alias h='history' | |
alias cd..='cd ..' | |
alias df='df -h' | |
export LANGUAGE=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
bleu="\[\e[0m\]\[\e[00;34m\]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://fr.archive.ubuntu.com/ubuntu/ jammy main restricted | |
deb http://security.ubuntu.com/ubuntu jammy-security main restricted | |
deb http://fr.archive.ubuntu.com/ubuntu/ jammy-updates main restricted | |
deb http://fr.archive.ubuntu.com/ubuntu/ jammy universe multiverse | |
deb http://security.ubuntu.com/ubuntu jammy-security universe multiverse | |
deb http://fr.archive.ubuntu.com/ubuntu/ jammy-updates universe multiverse | |
deb http://fr.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>fabric Creating rect with a mouse</title> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<meta name="robots" content="noindex, nofollow"> | |
<meta name="googlebot" content="noindex, nofollow"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name front_matter_block_github_blog | |
// @namespace brahimmachkouri | |
// @version 0.1 | |
// @description Paste the "Front Matter" block for Github blogs : go in the edit post and CTRL-V | |
// @author Brahim Machkouri | |
// @include https://github.com/*/new/main/_posts | |
// @grant GM_setClipboard | |
// @match none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# get list of VMs on the node | |
VMIDs=$(/usr/sbin/qm list| awk '/[0-9]/ {print $1}') | |
# ask them to shutdown | |
for VM in $VMIDs | |
do | |
/usr/sbin/qm shutdown $VM | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xxd -ps -c 1 $1 | awk '{ print "0x" $0 }' ORS=',' | sed s/.$// && echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
DISTRO= | |
OS= | |
if grep 'Debian' /etc/issue > /dev/null 2>&1 ; then |
NewerOlder