This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# yum3.sh | |
# v201303191415 | |
# https://blog.agate.pw | |
# [Tested on Fedora 18 x86_64 - yum-3.4.3-51 + python-2.7.3-13 + python3-3.3.0-1] | |
# yum refuses to deal with python3 as default python version | |
# here’s a simple and dirt python version switcher | |
# just copy to /bin/ and launch from your path as you would as usual |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# IP address change logger and notifier | |
# v.201303211157 | |
# http://korovamilky.tumblr.com | |
LOGGER="${HOME}/ip_change.log" | |
TMP_NOTIFY="/tmp/ip_notify.log" | |
HOST=$(hostname) | |
ADMIN_MAIL="[email protected]" #### #### #### <- CHANGE THIS #### | |
IP=$(curl -s icanhazip.com) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Filename: boot_prompt.sh | |
# Description: Shows connected interface(s) at boot and related ip address(es) on tty login prompt | |
# Usage: Put it somewhere (ie. /etc/init.d/) and then add its full path entry to /etc/rc.d/rc.local | |
# | |
# Author: marco[dot]agate@gmail[dot]com | |
# Version: 201304051644 | |
DSTFILE="/etc/issue" | |
KEEPLINE=$(head -n 1 ${DSTFILE}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# find-out-what-is-using-your-swap.sh | |
# -- Get current swap usage for all running processes | |
# -- | |
# -- rev.0.3, 2012-09-03, Jan Smid - alignment and intendation, sorting | |
# -- rev.0.2, 2012-08-09, Mikko Rantalainen - pipe the output to "sort -nk3" to get sorted output | |
# -- rev.0.1, 2011-05-27, Erik Ljungstrom - initial version | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<h1>Hi there,<br> | |
here's your IP Address: | |
<font color="red"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Send by e-mail new entries in the Bash history of all users. | |
# | |
# usage: mail-history <email> <subject> | |
# | |
TMPFILE=`tempfile 2>/dev/null` || TMPFILE=`mktemp` || exit 1 | |
declare -i CHANGES | |
CHANGES=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"auto_complete": false, | |
"caret_style": "solid", | |
"color_scheme": "Packages/Theme - Nil/Tubnil Bright.tmTheme", | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
"*.pid", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TMP_FILE="/tmp/hosts" | |
HOSTS_FILE="/etc/hosts" | |
# WINDOWS: %systemroot%\system32\drivers\etc\hosts | |
touch ${TMP_FILE} | |
for URL in http://adaway.org/hosts.txt \ | |
http://winhelp2002.mvps.org/hosts.txt \ | |
http://someonewhocares.org/hosts/hosts \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example email - real name list "<filename>" | |
# (note that name4 entry is broken - email appears 2 times | |
[email protected];"Real Name" | |
[email protected];"Real Name" | |
[email protected];"Real Name" | |
[email protected];[email protected];"Real Name" | |
# following awk will find and print the lines with MORE than one matching pattern | |
# (here I grep for "@") | |
$ awk '{n=split($0,c,"@")-1;if (n>1) print $0 }' <filename> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
confirm() { | |
echo -n "Continue? (y/n) " | |
read answer | |
case $answer in | |
y|Y|j|J"") return 0 ;; | |
n|N) return 1 ;; | |
*) confirm ;; | |
esac |
OlderNewer