Skip to content

Instantly share code, notes, and snippets.

View ychaouche's full-sized avatar

Yassine Chaouche ychaouche

View GitHub Profile
Got a list of helpful bash scripts/functions/aliases to deal with packages
/**************************/
/* 1. all package.* utils */
/**************************/
11:11:28 ~ -1- $ package.
package.count package.list.all
package.describe package.list.installed
17:16:27 ~ -1- $ openssl s_client -connect messagerie.algerian-radio.dz:993 -crlf
CONNECTED(00000003)
depth=3 C = GB, ST = Greater Manchester, L = Salford, O = Comodo CA Limited, CN = AAA Certificate Services
verify error:num=19:self signed certificate in certificate chain
verify return:0
---
Certificate chain
0 s:/CN=*.algerian-radio.dz
i:/C=GB/ST=Greater Manchester/L=Salford/O=Sectigo Limited/CN=Sectigo RSA Domain Validation Secure Server CA
1 s:/C=GB/ST=Greater Manchester/L=Salford/O=Sectigo Limited/CN=Sectigo RSA Domain Validation Secure Server CA
Start Time: 1727712531
Timeout : 300 (sec)
Verify return code: 19 (self signed certificate in certificate chain)
---
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLA
a login [email protected] password with spaces
a BAD Error in IMAP command received by server.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
77 authenticate PLAIN
+
xxx
77 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY MOVE QUOTA ACL RIGHTS=texk] Logged in
78 ID ("name" "Thunderbird" "version" "91.13.1")
* ID ("name" "Dovecot")
78 OK ID completed.
79 ENABLE UTF8=ACCEPT
79 OK Enabled.
Algeria DZA 1950 9018423
Algeria DZA 1951 9269869
Algeria DZA 1952 9521212
Algeria DZA 1953 9772646
Algeria DZA 1954 10014393
Algeria DZA 1955 10247428
Algeria DZA 1956 10482183
Algeria DZA 1957 10717503
Algeria DZA 1958 10953641
function printfln {
format_string="$1"
shift
printf "$format_string\n" "$@"
}
root@messagerie-recup[10.10.10.20] ~ # mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 52
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD("xxx");
# -*- shell-script -*-
export INTERFACE="eth4"
export PATH="$PATH":~/SYNCHRO/bin/ # put the path to where net.ip.private is
export BOOTTIME=$(sys.boottime)
Hello Mattia,
I hope this message finds you well.
At the end of your article about sensible-bash,
you write:
# Don't use ~ to define your home here, it won't work.
export dotfiles="$HOME/dotfiles"
export repos="$HOME/repos"
function mail.user.login.last {
command ls -1t /var/log/dovecot.log* |
while read -r filename;
do
match=$(zgrep -H --line-buffered --color -E "Login.*$1" "$filename" | tail -1);
if [[ -n "$match" ]];
then
echo "$match";
echo "that was a match, now I return 0."
return 0