Skip to content

Instantly share code, notes, and snippets.

#safe way to get wheezy or trusty info
cat /etc/*release | grep VERSION= | grep '7\|14'
@blindpet
blindpet / observiumdebianubuntu.sh
Last active March 1, 2020 15:37
installobserviumondebianubuntu
#!/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
#!/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
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
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 -----------------------------
@blindpet
blindpet / installtrans.sh
Last active August 29, 2015 14:25
Install transmission 2.84 on Wheezy
#!/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:
@blindpet
blindpet / purgevarnishsingle
Last active May 20, 2023 09:51
clear one url home page varnish cache
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
@blindpet
blindpet / findipsubnetgateway
Created July 22, 2015 01:47
bash match one word but exclude another
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:
@blindpet
blindpet / gist:3a78e12bdf3a11efa857
Created July 21, 2015 09:53
check mono version
mono --version | awk 'FNR == 1 {print $5}' | cut -c-4
@blindpet
blindpet / checklinuxdistro
Created July 17, 2015 14:02
check linux distro and grep
cat /etc/*release | grep -E "debian|ubuntu"