Skip to content

Instantly share code, notes, and snippets.

View SofianeHamlaoui's full-sized avatar
:octocat:
Making the world a better place

Sofiane Hamlaoui SofianeHamlaoui

:octocat:
Making the world a better place
View GitHub Profile
@SofianeHamlaoui
SofianeHamlaoui / colors.py
Created September 7, 2019 22:40
Python ANSI colors sequences
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
PURPLE = "\033[0;35m"
CYAN = "\033[0;36m"
LIGHT_GRAY = "\033[0;37m"
###########################################################
# TOOL NAME #
# SMALL DISC OF THE TOOL #
###########################################################
# -- Op-System: #
# -- Envirments : #
# -- Version: v #
# -- Developer: Sofiane Hamlaoui #
# -- Thanks: No One #
###########################################################
[ R00T MENU ]
Make A Choice
1) Text Editors
2) FTP/Torrent Applications
3) Download Managers
4) Network managers
5) VPN clients
6) Chat Applications
7) Image Editors
8) Video editors/Record
@SofianeHamlaoui
SofianeHamlaoui / colors.sh
Created September 7, 2019 22:47
Bash scripting colors
b='\033[1m'
u='\033[4m'
bl='\E[30m'
r='\E[31m'
g='\E[32m'
y='\E[33m'
bu='\E[34m'
m='\E[35m'
c='\E[36m'
w='\E[37m'
@SofianeHamlaoui
SofianeHamlaoui / connect.py
Last active September 11, 2019 22:52
Check Internet Connection , Check Network Connection Python
def checkconnect():
url='http://www.google.com/'
try:
_ = requests.get(url, timeout=2)
return True
except requests.ConnectionError:
exit(" \033[1;33;40m-[!]- YOU NEED INTERNET CONNECTION CONTINUE -[!]-\033[0m")
return False
@SofianeHamlaoui
SofianeHamlaoui / checkroot.sh
Created September 11, 2019 22:51
Check for Root permissions on bash
function checkroot {
showlogo && sleep 1
if [[ $(id -u) = 0 ]]; then
echo -e " Checking For ROOT: ${g}PASSED${endc}"
else
echo -e " Checking For ROOT: ${r}FAILED${endc}
${y}This Script Needs To Run As ROOT${endc}"
echo -e " ${b}Lockdoor Installer${enda} Will Now Exit"
echo
sleep 1
@SofianeHamlaoui
SofianeHamlaoui / checkpkgman.sh
Created September 11, 2019 22:54
Check what linux package manager is used [BASH]
function apt {
which apt > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
apt install THEPACKAGES
}
function pacman {
which pacman > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
pacman -S THEPACKAGES
}
@SofianeHamlaoui
SofianeHamlaoui / checkarch
Created September 11, 2019 22:55
Chcking Os Architecture on Linux
if [[ $(uname -m ) = x86_64 ]]; then
COMMAND
else
COMMAND
fi
}
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@SofianeHamlaoui
SofianeHamlaoui / git-pull-recursive.sh
Created December 26, 2019 02:52
Git pull Recursive for Lockdoor
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull origin master" \;