Skip to content

Instantly share code, notes, and snippets.

diff --git a/liquidprompt.bash b/liquidprompt.bash
index cad36bd..9d824d3 100644
--- a/liquidprompt.bash
+++ b/liquidprompt.bash
@@ -87,7 +87,7 @@ __user()
# if user is not root
if [ "$EUID" -ne "0" ] ; then
# if user is not login user
- if [[ ${USER} != $(logname) ]]; then
+ if [[ ${USER} != $(id -nu) ]]; then
@Zeuh
Zeuh / teamspeak3-init.d.sh
Last active September 19, 2018 18:27
A TeamSpeak3 init.d script
#!/bin/bash
### BEGIN INIT INFO
# Provides: teamspeak
# Required-Start: networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: TeamSpeak Server Daemon
# Description: Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO
@Zeuh
Zeuh / debian-reset-ssh-keys.pp
Created April 8, 2014 14:34
Puppet automatic upgrade for openssl and reset openssh server key on Debian due to CVE-2014-0160
# https://security-tracker.debian.org/tracker/CVE-2014-0160
file { '/etc/cron.d/reset-sshkeys-cron':
ensure => 'present',
content => "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n0 * * * * root [ ! -e /reset-ssh-key1 ] && touch /reset-ssh-key1 && apt-get update && apt-get install -y openssh-client openssh-server openssl libssl-dev libssl1.0.0 && /bin/rm /etc/ssh/ssh_host_* && /usr/sbin/dpkg-reconfigure openssh-server\n",
mode => '0644',
owner => 'root',
group => 'root',
}
@Zeuh
Zeuh / keybase.md
Created October 3, 2014 12:07
keybase.md

Keybase proof

I hereby claim:

  • I am Zeuh on github.
  • I am ze (https://keybase.io/ze) on keybase.
  • I have a public key whose fingerprint is 4335 0F73 833D 2A0A 9A3B 4F69 EAE8 42A5 F525 6DFE

To claim this, I am signing this object:

import signal
class InterruptableRegion(object):
def __init__(self, sig=signal.SIGINT):
self.sig = sig
self.interrupted = False
self.released = False
self.original_handler = None
def __enter__(self):
@Zeuh
Zeuh / make-pdo-oci-debian
Created June 29, 2015 13:00
Make PDO-OCI debian package
#!/bin/bash
#
# Requirement : Oracle instant client MUST be installed before.
#
myfile=$(readlink -f "$0")
mypath=$(dirname $myfile)
export ORACLE_BASE=`ls /usr/lib/oracle/ | sed 's#^#/usr/lib/oracle/#'`
export ORACLE_HOME=$ORACLE_BASE/client64
@Zeuh
Zeuh / bash_backup_all_mysql_databases.sh
Last active February 2, 2024 13:48 — forked from shakhmehedi/bash_backup_all_mysql_databases.sh
Bash scripts to backup all databases in a MySQL server with the option to exclude some databases.
#!/usr/bin/env bash
#
# This script backups selected databases in local MySQL server
#
# REQUIREMENTS
# - mysqldump bzip2
# - MySQL or MariaDB configured with one of theirs options :
# - auth_socket plugin for root access (modern default's auth method for root account)
# - /etc/mysql/debian.cnf with a valid privileged account
#