Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
from scripts.db_shell import *
from galaxy.util.bunch import Bunch
from galaxy.security import GalaxyRBACAgent
import argparse
import sys
import re
bunch = Bunch( **globals() )
@remyd1
remyd1 / lt.sh
Last active September 28, 2020 13:51
equivalent of bash command "ls -lt | head -n X" (you have to source it)
# This bash function is usefull to list most recent things in a directory.
#
# this script should not be run directly,
# instead you need to source it from your .bashrc,
# by adding this line:
# . ~/bin/lt
#
lt() {
comm="ls"
@remyd1
remyd1 / gist:7134789e97014e09ff33cba76f1863e1
Last active April 7, 2016 08:11
disks benchmarks with hdparm, dd, iozone
#!/bin/bash
set -e
if [ "$EUID" -ne 0 ]; then
echo "Please run this script as root"
exit
fi
echo "The device you want to test needs to be mounted. The script will write a 100MBytes and 1Gb file. It may take a long time depending mainly on your hardware..."
@remyd1
remyd1 / gist:a353b07219884c5878cc27d04aab9d96
Last active January 25, 2021 17:42
caldav_api bash with curl
#!/bin/bash
#set -x
source .client_config
usage="$0 report [START DATE (YYMMDD)] [END DATE (YYMMDD)] \n
or \n $0 propfind \n
or \n $0 get [ics] \n"
#!/usr/bin/env python
import pprint
import urllib
import salt.client
import salt.config
import sys
from pymongo import MongoClient
@remyd1
remyd1 / M-BCM-Remover.sh
Created January 26, 2017 11:05
M-[BC]M- remover
#!/bin/bash
#############################################################################
# SCRIPT: $0
# DESCRIPTION:
# This script will be able to detect hidden caracter "M-[BC]M-...",
# And/Or remove this !
# REVISIONS:
# 2014/06/11 YG
# UPDATE:
# 2016/03/29 remyd1
@remyd1
remyd1 / clear_all.sh
Last active June 18, 2020 14:29
cleaning salt from ext git
#!/bin/bash
CURDIR=`pwd`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
usage="usage:\n
$0 --[r]estart=no --with[g]it=no --[d]ebug=no --[e]rase=no --[l]ock=no --[c]ommit=''\n\n
- Between brackets is the short option format (you have to use it with only 1 dash (-), \n
eg :\"$0 -g=y\" ) \n
- Default is 'no' for all options (except 'commit' which is an empty value).\n
@remyd1
remyd1 / Dockerfile
Last active March 1, 2017 14:22
Modified version of linpackc.new from netlib (with a timeout (120s) and no question (using default array 200*200))
FROM centos:centos7
RUN yum update; yum clean all;
#RUN yum -y install epel-release; yum clean all
RUN yum -y install wget time gcc.x86_64 glibc-devel; yum clean all;
WORKDIR /usr/local/test
RUN wget https://gist.githubusercontent.com/remyd1/7711c3e6e5a12e674f6b6d773fe37472/raw/1b30a5bf88ec6098bc6a534ac7e4361abe4d3efe/linpack_simple_timeout.c
RUN wget https://gist.githubusercontent.com/remyd1/7711c3e6e5a12e674f6b6d773fe37472/raw/1b30a5bf88ec6098bc6a534ac7e4361abe4d3efe/get_flops.sh
RUN gcc -O3 -march=native -o linpack_simple -lm linpack_simple_timeout.c
# run the benchs
DKMS make.log for zfs-0.6.5.9 for kernel 3.10.0-693.5.2.el7.x86_64 (x86_64)
mer. nov. 22 16:07:52 CET 2017
make all-recursive
make[1] : on entre dans le répertoire « /var/lib/dkms/zfs/0.6.5.9/build »
Making all in include
make[2] : on entre dans le répertoire « /var/lib/dkms/zfs/0.6.5.9/build/include »
Making all in linux
make[3] : on entre dans le répertoire « /var/lib/dkms/zfs/0.6.5.9/build/include/linux »
make[3]: Rien à faire pour « all ».
make[3] : on quitte le répertoire « /var/lib/dkms/zfs/0.6.5.9/build/include/linux »
FROM fedora:27
RUN dnf -y update && dnf install -y skopeo