Skip to content

Instantly share code, notes, and snippets.

View souhaiebtar's full-sized avatar
:octocat:
Focusing

souhaiebtar

:octocat:
Focusing
View GitHub Profile
@souhaiebtar
souhaiebtar / commands.sh
Last active January 16, 2020 07:17
[linux command] a few good linux command to remember #linux #cli
# encrypt all files with the header
```bash
7z a -p"pbVfdPs27Dc" -mhe hello.7z file1.bin file2.doc files.*
```
## https://bytefreaks.net/gnulinux/bash/create-an-encrypted-7zip-archive-with-encrypted-header-as-well-no-filenames-are-visible
@souhaiebtar
souhaiebtar / .xbindkeysrc
Last active April 18, 2025 12:05
[kbindkeys key-map for logitech mx-master mouse] mouse map for xbindkeys #xbindkeys #logitech #mouse
# need to install xbindkeys xdotool
# map for the logitech mx master (change volume using the side wheel, and change chrome browser tab using side button
# thumb wheel up => increase volume
# create file ~/.xbindkeysrc with this content, then load settings using 'xbindkeys --poll-rc'
"pactl set-sink-volume @DEFAULT_SINK@ +2%"
b:6
# thumb wheel down => lower volume
"pactl set-sink-volume @DEFAULT_SINK@ -2%"
@souhaiebtar
souhaiebtar / record test script using jmeter
Last active January 27, 2020 10:40
[Load test using jmeter] load test for erp website #jmeter #load-test
# install jmeter 5
`File` -> `Templates...` -> `Recording with Think Time`
than configure your browser(firefox for example) to use `config` from `Http Test script recorder`
generate a report file (-JmyPauseProperty=0 is for running the test without pauses ,start no pauses)
`./jmeter -JmyPauseProperty=0 -n -t ~/Desktop/jmeter/tsouhaieberp.jmx -l ~/Desktop/erpResults.jtl`
generate a dashboard (make sure that the dashboard folder is empty)
@souhaiebtar
souhaiebtar / formatNestedObject.js
Last active January 27, 2020 10:45
[format nest object] help when debugging objects #js #javascript #nested-object
function myStringify(obj, maxDeepLevel = 2) {
if (obj === null) {
return 'null';
}
if (obj === undefined) {
return 'undefined';
}
if (maxDeepLevel < 0 || typeof obj !== 'object') {
return obj.toString();
@souhaiebtar
souhaiebtar / dbeaver.ini
Last active February 21, 2025 13:35
[dbeaver config file] .ini file for dbeaver #dbeaver #linux
# path on linux /usr/share/dbeaver/dbeaver.ini
# path on macos /Applications/DBeaverEE.app/Contents/Eclipse/dbeaver.ini
-vm
/usr/bin/java
-startup
plugins/org.eclipse.equinox.launcher_1.5.600.v20191014-2022.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190907-0426
-vmargs
-javaagent:/home/tunknown/.apps/dbeaver/dbeaver-agent.jar
@souhaiebtar
souhaiebtar / change_deb.sh
Created March 19, 2020 08:43
[change dependency for a .deb file] script to change dependency #linux #deb #shell
dpkg-deb -R ./Brackets.Release.1.14.64-bit.deb Brackets
sed -i 's/libcurl3/libcurl3 | libcurl4/' Brackets/DEBIAN/control
dpkg-deb -b Brackets Brackets-fixed.deb
sudo apt install -f ./Brackets-fixed.deb
@souhaiebtar
souhaiebtar / pi_blocklist_porn_top1m.list
Last active March 28, 2020 14:46
[pihole porn blocklist] list of the first 1m porn site visited (data from alexa) to be blocked #pihole #linux
livejasmin.com
bongacams.com
chaturbate.com
pornhub.com
xvideos.com
xhamster.com
xnxx.com
pornhubpremium.com
51.la
youporn.com
@souhaiebtar
souhaiebtar / regex_list.md
Last active May 24, 2020 00:09
[regex_list.md] some regex to use with different software and language #regex #vscode
  • list all string that have estimate_ that is not followed by request
estimate_((?!request))
  • list all string that start log_message, even it's precedded with space character or tab character
^[\t ]*log_message
@souhaiebtar
souhaiebtar / .vimrc
Created May 9, 2020 15:04
[change between tab and space as indent] config for vim #vim #vimrc
set tabstop=2 " Size of a hard tabstop (ts).
set shiftwidth=2 " Size of an indentation (sw).
set expandtab " Always uses spaces instead of tab characters (et).
set softtabstop=0 " Number of spaces a <Tab> counts for. When 0, featuer is off (sts).
set autoindent " Copy indent from current line when starting a new line.
set smarttab " Inserts blanks on a <Tab> key (as per sw, ts and sts).
set number " show number
@souhaiebtar
souhaiebtar / nginx.md
Created May 13, 2020 12:09
[nginx config and default path] #nginx #ssl #letsencrypt

nginx default config file path /etc/nginx/nginx.conf