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
server { | |
server_name default_server; | |
access_log /var/log/nginx/htpcguides.com.access.log; | |
error_log /var/log/nginx/htpcguides.com.error.log; | |
root /var/www/htpcguides.com/; | |
index index.php; | |
location / { |
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
mysqldump -u [user] -p[password] [database] [table] > [output_file_name].sql | |
mysqldump -p --user=example --where="x = 'y' AND id = 2" dbname tablename >> dump.sql | |
#dumping last rows | |
mysqldump -uroot -p db_name table_name --where='id<1000000' | |
or you can use | |
SELECT * INTO OUTFILE 'data_path.sql' from table where id<100000 |
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" |
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
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
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
#!/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
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
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
#!/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 |
OlderNewer