Skip to content

Instantly share code, notes, and snippets.

View 0x07CB's full-sized avatar
🎯
Focusing

0x07CB 0x07CB

🎯
Focusing
View GitHub Profile
@0x07CB
0x07CB / refresh-inbox.sh
Created February 1, 2024 18:18
claws-automation
#!/bin/bash
email_inbox_total=$(claws-mail --status-full inbox | tail -n 1 | awk '{$1=""; $2=""; print}')
claws-mail --receive-all
email_inbox_total_new=$(claws-mail --status-full inbox | tail -n 1 | awk '{$1=""; $2=""; print}')
if [[ $email_inbox_total_new -gt $email_inbox_total ]]; then
notify-send "New mail received (email)" "You have $(( $email_inbox_total_new - $email_inbox_total )) new mail(s) in your inbox."
@0x07CB
0x07CB / gist:693e65107312f478ce24d24f7e0ea94c
Created February 1, 2024 16:45
How to: Take a Screenshot Debian Terminal with scrot
Pour faire une capture d'écran sur Debian via le terminal, vous pouvez utiliser l'outil `scrot`. Si `scrot` n'est pas déjà installé sur votre système, vous pouvez l'installer en utilisant le gestionnaire de paquets. Voici les étapes à suivre :
1. **Installer `scrot`** :
Ouvrez le terminal et exécutez la commande suivante pour installer `scrot` :
```
sudo apt-get install scrot
```
2. **Prendre une capture d'écran** :
- Pour capturer tout l'écran et enregistrer l'image dans votre répertoire personnel, tapez :
@0x07CB
0x07CB / virtualenv.md
Created February 1, 2024 16:27
environnements virtuels avec pip pour Python 3

La création et la gestion d'environnements virtuels avec pip pour Python 3 est une pratique courante pour isoler des projets Python les uns des autres, afin de gérer les dépendances de manière propre. Voici les étapes principales pour créer et gérer un environnement virtuel avec pip :

1. Installation de virtualenv (si nécessaire) :

Si vous n'avez pas déjà virtualenv installé, vous pouvez le faire avec pip en utilisant la commande suivante (assurez-vous d'avoir Python 3.x installé) :

pip install virtualenv
@0x07CB
0x07CB / UDP_RSA_Listener.py
Created February 1, 2024 16:23
Reverse Shell over UDP with RSA encryption
#coding: utf-8
import rsa
import socket
class UDP_Server:
def __init__(self, host, port):
self.host = host
self.port = port
@0x07CB
0x07CB / SHEET_01.md
Last active January 28, 2024 15:31
REGEX BASH CHEATSHEET - 01282024

TRAITEMENT D'UN FICHIER LICENSE ( GPLv3 )

Je voulais une commande bash utilisant le regex pour lister toutes les informations entre un '<' et un '>' afin de lister les zones a completer dans un fichier LICENSE (type: GNU GPL v3).

Essai numéro 1:

Cette commande bash utilise grep avec une expression régulière (regex) pour lister toutes les informations entre un < et un > dans un fichier texte.

grep -o '<[^>]*>' LICENSE
@0x07CB
0x07CB / evaluate_sodoku.md
Last active January 27, 2024 17:27
sodoku creation docs

Évaluer la difficulté d'une grille de Sudoku en Python est un peu plus complexe, car cela implique de tenir compte de plusieurs facteurs, tels que le nombre de cases vides, la distribution de ces vides, et les techniques nécessaires pour résoudre la grille. Il n'existe pas de méthode standard ou universellement acceptée pour cela, mais je peux vous donner un exemple basique qui utilise une approche simple pour estimer la difficulté.

L'exemple suivant évalue la difficulté en fonction du nombre de cases vides et de la distribution des nombres dans la grille :

Exemple: Évaluation Basique de la Difficulté

import numpy as np

def count_empty_cells(sudoku):
@0x07CB
0x07CB / opensslCommandExtraction.py
Last active January 3, 2024 12:51
OpenSSL Commands Extraction
#!/usr/bin/python3
#coding: utf-8
import os
import subprocess
from base64 import b64encode as b64enc
from base64 import b64decode as b64dec
def gen_tpl_sub_opt_help_call_cmnd(opt_helper_0=""):
@0x07CB
0x07CB / gist:490233dfe3caabbb51891146f3e50657
Created August 30, 2023 08:18 — forked from arcenet/gist:24015f4e34a00bbaa8f3bcc64c1745e6
Installing haveged on Debian/Ubuntu
apt-get install haveged
nano /etc/default/haveged # Setup DAEMON_ARGS="-w 1024"
update-rc.d haveged defaults
cat /dev/random | rngtest -c 1000 # Testing Availability of Entropy & Quality of Random Data
cat /proc/sys/kernel/random/entropy_avail # To test the amount of available entropy
@0x07CB
0x07CB / clamav-test.sh
Last active February 1, 2024 16:36
clamav-test scripts - # 1
#!/bin/bash
#
#
function test_clamav_(){
TEST_OUT_=$(curl https://secure.eicar.org/eicar.com.txt | clamscan -)
RESULT_=$(echo $TEST_OUT | grep "stdin : Win.Test.EICAR_HDB-1 FOUND" | wc -l)
if [[ "$RESULT_" != "0" ]]; then
return 1
else
@0x07CB
0x07CB / clean_audio.sh
Created June 15, 2023 11:44 — forked from devoncrouse/clean_audio.sh
Using Sox (http://sox.sourceforge.net) to remove background noise and/or silence from audio files (individually, or in batch).
# Create background noise profile from mp3
/usr/bin/sox noise.mp3 -n noiseprof noise.prof
# Remove noise from mp3 using profile
/usr/bin/sox input.mp3 output.mp3 noisered noise.prof 0.21
# Remove silence from mp3
/usr/bin/sox input.mp3 output.mp3 silence -l 1 0.3 5% -1 2.0 5%
# Remove noise and silence in a single command