Skip to content

Instantly share code, notes, and snippets.

View osallou's full-sized avatar

Olivier Sallou osallou

View GitHub Profile
@osallou
osallou / showdests.sh
Created November 16, 2021 10:37
show postfix mail destinations in queue
#!/bin/bash
mailq |grep " " | grep "@" | tr -s ' ' | rev | cut -d ' ' -f 1 | rev
@osallou
osallou / postfix_clean.sh
Created November 16, 2021 10:00
Cleanup postfix with string match
#!/bin/bash
[ ! -n "$1" ] && echo "Usage : $0 mail" && exit 1
for mail in $( mailq|egrep '^[A-Z0-9]'|grep "$1"|awk '{print $1}'|sed 's/^\([0-9A-Z]*\).*$/\1/' )
do
/usr/sbin/postsuper -d $mail
done
@osallou
osallou / README.md
Last active April 26, 2021 15:23 — forked from mosquito/README.md
Add docker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
Check Top Processes sorted by RAM or CPU Usage in Linux:
ps -eo uid,pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
Credits: https://www.tecmint.com/find-linux-processes-memory-ram-cpu-usage/
@osallou
osallou / gist:2751bb984a5e0187418eca4d05c7179c
Created April 24, 2020 13:41
Tunnel to internal network
sshuttle -r genossh.genouest.org 192.168.1.0/0
@osallou
osallou / gist:7bd317aa81783d5543f193e58d01dec1
Created December 27, 2019 09:12
Generate changelog from git
Put a #changelog tag in commit message and it will be selected by next cmd (from last tag)
Best to prefix commit by kind of modificiation, [feature], [fix]
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:'* [https://gitlab.inria.fr/osallou/logol2-client/commit/%H](view commit) %s' --reverse | grep "#changelog"
#!/bin/bash
#small script to enable root access to x-windows system
xhost +SI:localuser:root
sudo $1
#disable root access after application terminates
xhost -SI:localuser:root
docker run -p 6443:443 -e PHPLDAPADMIN_LDAP_HOSTS=IP_OF_LDAP osixia/phpldapadmin:0.9.0
diff --git a/biomaj_download/download/ftp.py b/biomaj_download/download/ftp.py
index 78b5d24..92dd0d6 100644
--- a/biomaj_download/download/ftp.py
+++ b/biomaj_download/download/ftp.py
@@ -290,13 +290,17 @@ class FTPDownload(DownloadInterface):
# the individual fields in this list of parts
if not parts:
continue
- rfile['permissions'] = parts[0]
- rfile['group'] = parts[2]
# list node infos with used/avail cpus
sinfo -N -l -o "%P %C %.5a %.10l %.6D %.6t %N"