Skip to content

Instantly share code, notes, and snippets.

@opennomad
opennomad / snippy.sh
Last active November 5, 2019 15:59 — forked from coderofsalvation/snippy.sh
Snippy text expander
#!/usr/bin/env bash
# video demo at: http://www.youtube.com/watch?v=90xoathBYfk
# augmented by "opennomad": https://gist.github.com/opennomad/15c4d624dce99066a82d
# originally written by "mhwombat": https://bbs.archlinux.org/viewtopic.php?id=71938&p=2
# Based on "snippy" by "sessy"
# (https://bbs.archlinux.org/viewtopic.php?id=71938)
#
# You will also need "dmenu", "zenity", "xsel" and "xdotool". Get them from your linux
# distro in the usual way.
@matgou
matgou / hotbackup.sh
Last active December 4, 2019 07:38
Hot-backup of mysql with btrfs
#!/bin/bash
#@****************************************************************************
#@ Author : Mathieu GOULIN (mathieu.goulin@gadz.org)
#@ Organization : Gadz.org (www.gadz.org)
#@ Licence : GNU/GPL
#@
#@ Description :
#@
#@ Prerequisites :
#@ Arguments :
@xPaw
xPaw / localhost_cert.sh
Last active January 1, 2022 20:23
Localhost certificate
#!/bin/bash
openssl ecparam -name prime256v1 -genkey -out localhost.key
openssl req -new -x509 -days 7300 -out localhost.crt -key localhost.key \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost, DNS:*.localhost, IP:127.0.0.1, IP:::1\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
openssl dhparam -out dhparam.pem 4096
@tessro
tessro / kill-slow-queries.sh
Created June 6, 2012 18:51
A script for killing slow MySQL queries, suited for a cron job
#!/bin/sh
# Credentials for a MySQL user with PROCESS, SUPER permissions
USERNAME=
PASSWORD=
# MySQL Server location
HOST=127.0.0.1
PORT=3306
@amit-chahar
amit-chahar / download-script.sh
Last active February 20, 2023 12:57
Scirpt to download files from Google drive using curl (Detailed explanation can be read here: https://stackoverflow.com/a/49444877/4043524)
#!/bin/bash
fileid="FILEIDENTIFIER"
filename="FILENAME"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename}
@Ndrou
Ndrou / clean-db.sql
Created March 8, 2017 10:03
Clean prestashop 1.6 database
DELETE FROM ps_accessory WHERE id_product_1 NOT IN (select p.id_product from ps_product p);
DELETE FROM ps_accessory WHERE id_product_2 NOT IN (select p.id_product from ps_product p);
DELETE FROM ps_address WHERE id_customer NOT IN (select c.id_customer from ps_customer c);
DELETE FROM ps_product_comment WHERE id_product NOT IN (select p.id_product from ps_product p);
DELETE FROM ps_product_comment_grade WHERE id_product_comment NOT IN (select pc.id_product_comment from ps_product_comment pc);
DELETE FROM ps_product_comment_usefulness WHERE id_product_comment NOT IN (select pc.id_product_comment from ps_product_comment pc);
DELETE FROM ps_product_lang WHERE id_product NOT IN (select p.id_product from ps_product p);
@floptwo
floptwo / php-cli_ovh_mutu.md
Last active April 25, 2023 08:40
OVH PHP-CLI

PHP-CLI (PHP en ligne de commande) sur les hébergements mutualisés OVH

More complete info here http://cluster015.ovh.net/infos/ (thanks to @42antoine)

(cli)

/usr/local/php5.3/bin/php => PHP 5.3.29 (cli) (built: Nov 21 2017 08:55:07)
/usr/local/php5.4/bin/php => PHP 5.4.45 (cli) (built: Nov 21 2017 08:35:51)
/usr/local/php5.5/bin/php => PHP 5.5.38 (cli) (built: Nov 21 2017 08:46:45)
@thisismitch
thisismitch / haproxy.cfg
Last active November 11, 2023 04:08
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@coderofsalvation
coderofsalvation / snippy.sh
Last active January 24, 2024 08:56
modified version of snippy which features easier installation, follows symlinks, bashdown templates and automatic detection of cli vs window
#!/bin/bash
# video demo at: http://www.youtube.com/watch?v=90xoathBYfk
# written by "mhwombat": https://bbs.archlinux.org/viewtopic.php?id=71938&p=2
# Based on "snippy" by "sessy"
# (https://bbs.archlinux.org/viewtopic.php?id=71938)
#
# You will also need "dmenu", "xsel" and "xdotool". Get them from your linux
# distro in the usual way.
#
@kslimani
kslimani / ixgbe_debian.md
Last active January 29, 2024 19:10
Debian ixgbe module compilation