Skip to content

Instantly share code, notes, and snippets.

View Sanix-Darker's full-sized avatar
🐼
coding in the dark...

darker Sanix-Darker

🐼
coding in the dark...
View GitHub Profile
git_open_link(){
# $1 can be 'origin' or 'dev' depending on the source
remote_link=$(git remote get-url $1)
browser=firefox
CURL_CHECK="curl --head --silent --fail"
if $CURL_CHECK "$remote_link" &> /dev/null; then
$browser $remote_link;
else
built_link=$(echo "https://$(echo $remote_link | sed -e 's/git@//' | sed -e 's/:/\//')")
if $CURL_CHECK "$built_link" &> /dev/null; then
#!/bin/bash
# run a command again and again only if the standard output hash change by a single bit
# _inf git status
_inf(){
echo "Executing '$@' until the output change or you quit:"
# we source our alias first
PREVIOUS_HASH=""
while true; do
CURRENT_HASH=$($(echo "${@}") | md5sum)
if [ "$CURRENT_HASH" != "$PREVIOUS_HASH" ]; then
#!/bin/bash
# a confirm check before executing anything
# _confirm "your message" your command there
_confirm(){
args=("${@}")
if [[ $NOTINTERACTIVE = "1" ]]; then
echo -e "\n$BLUE[+] ${args[0]} $COLOROFF"
callback=${args[@]:1}
$callback
else
#!/bin/bash
clean_volumes(){
# List all volumes from docker volume
# then remove the first line
# sed to delete "local " from the /tmp/volumes
# and then apply the docker volume rm on each lines from that file
docker volume ls > /tmp/volumes && \
tail -n +2 /tmp/volumes && \
sed -i 's/local //g' /tmp/volumes && \
@Sanix-Darker
Sanix-Darker / .bash_aliases
Last active October 22, 2025 01:26
note: a simple command line for fast todo topic oriented
#!/bin/bash
# To take note about something really quickly
# Requirements : fzf and ag
#
# $ note topic note to my self... # will add a new note for the topic
# $ note topic # will seach for notes on this topic
# $ note # will list for you all notes taken globally
note(){
NOTES_DIR=$HOME/notes/
@Sanix-Darker
Sanix-Darker / gf.sh
Last active October 3, 2025 12:10
[SHELL] git finder
#!/bin/bash
# by d4rk3r
# A smart way to search for a code
# inside your git history whatever the branch you're
# -- Setup :
# -- After getting the bash script
# chmod +x /path/to/gf.sh
@Sanix-Darker
Sanix-Darker / doc.md
Created June 28, 2025 21:47
PHP 8.3 with ZTS (Zend Thread Safety) and pthreads

PHP 8.3 with ZTS (Zend Thread Safety) and pthreads

Here's an updated guide for compiling PHP 8.3 with ZTS support, which is required for pthreads or parallel extensions:

Prerequisites

sudo apt-get update
sudo apt-get install -y build-essential autoconf bison re2c \
    libxml2-dev libsqlite3-dev libssl-dev zlib1g-dev \
@Sanix-Darker
Sanix-Darker / [PYTHON]checkIfProcessRunning.py
Last active June 15, 2025 20:22
[PYTHON] Check if a process is running by it's name
# By Sanix darker
# With this script you can check if a process is running by it's name
#
# Install dependencies by hiting : pip install psutil
#
# Then launch the script : python checkIfProcessRunning.py
import psutil
@Sanix-Darker
Sanix-Darker / FreeCad__SEGFAULT__solution.md
Created May 17, 2025 22:34
FreeCad Program received signal SIGSEGV, Segmentation fault FIXED.

I was trying to use FreeCad, i then downloaded the release's AppImage available for CPU arch; but i was unable to have it running on my linux machine, which specs are :

$ stackfetch ?
=== System ===
OS: ubuntu 20.04
Arch: amd64
CPUs: 8
Kernel: 5.15.0-139-generic
@Sanix-Darker
Sanix-Darker / SUBLIME TEXT 2.X, 3.X UNIVERSAL LICENSE CRACK KEYS COLLECTION FOR WIN, MAC & LINUX WORKING
Created September 17, 2017 20:07
SUBLIME TEXT 2.X, 3.X UNIVERSAL LICENSE CRACK KEYS COLLECTION FOR WIN, MAC & LINuX WORKING
// Sublime Text 3 License Keys //
Sublime Text 2.x (for all Builds)
—– BEGIN LICENSE —–
Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
942194A6 02396E98 E62C9979 4BB979FE
91424C9D A45400BF F6747D88 2FB88078