Skip to content

Instantly share code, notes, and snippets.

View ychaouche's full-sized avatar

Yassine Chaouche ychaouche

View GitHub Profile
#250824 13:50:36 server id 1 end_log_pos 52469755 CRC32 0x73d17664 Query thread_id=189646 exec_time=0 error_code=0
SET TIMESTAMP=1756039836/*!*/;
COMMIT
/*!*/;
# at 52469755
#250824 13:59:06 server id 1 end_log_pos 52469797 CRC32 0xfebe2cd6 GTID 0-1-287315
/*!100001 SET @@session.gtid_seq_no=287315*//*!*/;
BEGIN
/*!*/;
# at 52469797
@ychaouche
ychaouche / apt error
Created August 20, 2025 17:23
apt error
root@app-server[10.10.10.83] ~ # apt-get update
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Reading package lists... Done
W: Skipping acquire of configured file 'updates/source/Sources' as repository 'http://security.debian.org/debian-security bookworm-security InRelease' doesn't have the component 'updates' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'updates/binary-amd64/Packages' as repository 'http://security.debian.org/debian-security bookworm-security InRelease' doesn't have the component 'updates' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'updates/i18n/Translation-en_US.UTF-8' as repository 'http://security.debian.org/debian-security bookworm-security InRelease' doesn't have the component 'updates' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'updates/i18n/T
@ychaouche
ychaouche / why remove mariadb?
Created August 19, 2025 09:26
why remove mariadb?
root@app-server[10.10.10.83] ~ # apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
default-mysql-server dh-python emacs24-nox g++-6 galera-3 libaio1 libbabeltrace-ctf1 libbind9-140 libblas-common libboost-filesystem1.62.0 libboost-iostreams1.62.0 libboost-system1.62.0 libconfig-inifiles-perl libdbd-mysql-perl
libdbi-perl libdbus-glib-1-2 libdns162 libevent-2.0-5 libgfortran3 libgmime-2.6-0 libisc160 libisccc140 libisccfg140 libjemalloc1 libjs-angularjs libjs-lodash liblwres141 libmagickcore-6.q16-3 libmagickwand-6.q16-3 libnotmuch4
libperl5.24 libpython3.5 libpython3.5-minimal libpython3.5-stdlib libreadline5 libsnappy1v5 libstdc++-6-dev libtalloc2 libterm-readkey-perl libunbound2 libwebpmux2 libxerces-c3.1 libxml-security-c17v5 mariadb-client-10.3
mariadb-client-core-10.3 mariadb-server-10.3 mariadb-server-core-10.3 php7.0-dev python-gpgme python-idna python-oauth python-pyasn1 python
@ychaouche
ychaouche / add-newline-after-punctuation.el
Last active July 24, 2025 15:02
add-newline-after-punctuation.el
(defun add-newline-after-punctuation9 (start end)
"Place a newline after each sequence of 4 or more words followed by a comma, semicolon, colon, or period in the region."
(interactive "r")
(save-excursion
(goto-char start)
(while (re-search-forward "\\(\\w+\s+\\)\\{3,\\}\\w+\s*[.,:;])" end t)
(replace-match "\\&\n"))))
@ychaouche
ychaouche / lsync tutorial
Last active July 21, 2025 09:10
Lsync tutorial
Using lsyncd to synchronize file changes across multiple hosts
Posted 07-18-22 at 06:00 PM by ychaouche
Updated 05-30-23 at 07:12 AM by ychaouche
Tags live synchronization, lsyncd, rsync
In my own machine,
I create a directory named SYNC.
I put all the files I need to synchronize with other machines in there,
and have their original locations be symlinks to their new location inside the SYNC directory.
12:07:35 ~/NOTES/TXT -1- $ type net.paste0x0
net.paste0x0 is a function
net.paste0x0 ()
{
local useragent="net.paste0x0 by https://github.com/ychaouche";
echo "net.paste0x0 $1";
if (($#)); then
filepath="$1";
filename="$(basename "$filepath")";
mkdir /tmp/net.paste0x0/ 2> /dev/null;
@ychaouche
ychaouche / txt.headers
Last active July 15, 2025 11:05
Display headers from an outlined document
#!/bin/bash -i
# we need debug
file="$1"
sublevels=1
postprocess=cat
for arg
do
case "$arg" in
-[1-9])
@ychaouche
ychaouche / libx32
Last active February 27, 2025 16:54
/lib/ is for 32-bit apps
/libx32/ is for the 32x ABI
In the new "x32" ABI x86_64-linux-gnux32,
inspired by SGI n32 environment,
registers are 64 bits,
but pointers, integers and longs are only 32 bits,
saving a lot of memory in pointer-heavy workflows.
It also ensures all the other 64-bit only processor features are available,
resulting in to about 30% reduction in memory usage
function helpless() {
# ______________________________________________________________________
# /\ \
# \_| some commands don't support --help nor -h flags |
# | and so command --help or command -h results in a error exit code |
# | and a display of the "usage" on stderr. |
# | |
# | some other commands will tell you that --help isn't supported |
# | and print an error message that asks you to use -h instead |
# | |
15:22:19 ~ -1- $ apt-cache show libruby1.9.1 | grep -E '(Depends|Package)' | pretty.ellipsis
Package: libruby1.9.1
Depends: ruby1.9.1 (= 1.9.3.484-2ubuntu1.14), ca-certificates, libc6 (>= 2.14), libffi6 (>= 3.0.4), libgdbm3 (>= 1.8.3), libncursesw5 (>= 5.6+20070908), libreadline6 (>= 6.0), libssl1.0.0 (>= 1.0.0), libtinfo5, libyaml-0-2, zlib1...
Package: libruby1.9.1
Depends: ruby1.9.1 (= 1.9.3.484-2ubuntu1), ca-certificates, libc6 (>= 2.14), libffi6 (>= 3.0.4), libgdbm3 (>= 1.8.3), libncursesw5 (>= 5.6+20070908), libreadline6 (>= 6.0), libssl1.0.0 (>= 1.0.0), libtinfo5, libyaml-0-2, zlib1g (...
15:40:53 ~ -1- $ apt-cache show ruby1.9.1 | grep -E '(Depends|Package)' | pretty.ellipsis
Package: ruby1.9.1
Depends: ruby (>= 1:1.9.3.1), libruby1.9.1 (= 1.9.3.484-2ubuntu1.14), libc6 (>= 2.2.5)
Package: ruby1.9.1
Depends: ruby (>= 1:1.9.3.1), libruby1.9.1 (= 1.9.3.484-2ubuntu1), libc6 (>= 2.2.5)