Skip to content

Instantly share code, notes, and snippets.

@almir
almir / 99-disable-wireless-when-wired
Last active April 16, 2019 10:40
Disable Wi-Fi when LAN cable is plugged in and enable it when the cable is plugged out
#!/bin/sh
IFACE="${1}"
ACTION="${2}"
ntfy () {
LOGGED_USERS=$(users)
for user in ${LOGGED_USERS}
do
@almir
almir / terminator-config
Last active July 17, 2023 14:40
Configure Terminator to act like Guake, run at login and run continuously
[global_config]
always_on_top = True
borderless = True
dbus = True
enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, Logger, LaunchpadBugURLHandler
geometry_hinting = False
hide_from_taskbar = True
sticky = True
tab_position = bottom
title_hide_sizetext = True
@almir
almir / manage-dotfiles.sh
Last active May 23, 2016 16:31
Shell script for managing dotfiles
#!/bin/bash
######################################################################################
## Script for managing dotfiles
##
## IMPORTANT: This script should be located inside the directory where you keep
## your dotfiles, otherwise it will not work.
######################################################################################
######################################################################################
@almir
almir / diskspacecheck.sh
Last active May 23, 2016 16:31
Shell script to monitor or watch the disk space
#!/bin/sh
#
# Shell script to monitor or watch the disk space
# It will send an email to $ADMINEMAIL, if the (free avilable) percentage
# of space is >= 90%
#
# Linux shell script to watch disk space (should work on other UNIX OSes)
# SEE URL: http://www.cyberciti.biz/tips/shell-script-to-watch-the-disk-space.html
#
# set admin email so that you can get email
@almir
almir / mysqlfailover
Last active July 16, 2018 20:49
Service script for mysqlfailover utility
#!/bin/bash
### BEGIN INIT INFO
# Provides: mysqlfailover
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network $time
# Should-Stop: $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6