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
#safe way to get wheezy or trusty info | |
cat /etc/*release | grep VERSION= | grep '7\|14' |
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
#!/usr/bin/env bash | |
mysqlpass="passw0rd" | |
observiumsqluser="observiumsqluser" | |
observiumsqlpass="observiumsqlpass" | |
observiumsqldb="observiumsqldatabase" | |
observiumuilogin="admin" | |
observiumuipass="admin" | |
#one line install: wget https://goo.gl/u6SjgB -O observiumdebian.sh && sudo bash observiumdebian.sh |
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
#!/usr/bin/env bash | |
echo Enter full URL to purge | |
read url | |
curl -s $url -H "Cache-Control: no-cache" -o /dev/null | |
echo Refreshed $url |
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
sudo stat /proc/1/exe | |
sudo stat /proc/1/exe | grep -i file | awk '{print $4}' | grep 'systemd\|upstart\|init' | |
cut as well http://linuxpoison.blogspot.hu/2012/08/bash-script-string-manipulation-find-cut.html | |
http://unix.stackexchange.com/questions/196166/how-to-find-out-if-a-system-uses-sysv-upstart-or-systemd-initsystem |
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
http://giantdorks.org/alain/a-shell-script-to-refresh-a-predefined-set-of-pages-in-varnish-cache/ | |
cmd="sudo varnishadm -T 127.0.0.1:6082 -S /etc/varnish/secret" | |
site="http://www.htpcguides.com" | |
pages=" | |
/ | |
/feed | |
" | |
echo ----------------------------- |
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 | |
# edited 2015.04.20 15:50 est from https://forum.transmissionbt.com/viewtopic.php?f=1&t=16887#p70825 | |
set -e | |
SCRIPT="$(readlink -e ""$0"")" | |
## install dependencies and required compiling tools from standard repos | |
sudo apt-get update | |
sudo apt-get -y install build-essential checkinstall pkg-config libtool intltool libcurl4-openssl-dev libssl-dev libevent-dev | |
sudo sed -i 's/TRANSLATE=1/TRANSLATE=0/' /etc/checkinstallrc | |
#-uncomment if needed: |
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
Enter varnish admin | |
varnishadm | |
clear cache for index home page only | |
ban req.http.host ~ www.htpcguides.com && req.url ~ "^/$" | |
clear cache for specific page |
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
use double grep | |
command | grep 'what you want' | grep -v 'whatyoudontwant' | |
Or use awk | |
awk '/XXX/ && !/YYY/' file | |
^^^^^ ^^^^^^ | |
I want it I don't want it | |
You can even say something more complex. For example: I want those lines containing either XXX or YYY, but not ZZZ: |
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
mono --version | awk 'FNR == 1 {print $5}' | cut -c-4 |
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
cat /etc/*release | grep -E "debian|ubuntu" |
NewerOlder