This file contains 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 | |
# http://serverfault.com/a/726024/210437 | |
killall -KILL node |
This file contains 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 | |
# NB: First install nscd with sudo apt-get install nscd | |
# run this command to flush dns cache: | |
sudo /etc/init.d/dns-clean restart | |
# or use: | |
sudo /etc/init.d/networking force-reload | |
# Flush nscd dns cache: | |
sudo /etc/init.d/nscd restart |
This file contains 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 | |
# Example: /home/username/Downloads/software.tar.gz | |
echo -n "Full path of the file to upload: "; | |
read fileLocation; | |
# Example: /var/www/mydomain/software.tar.gz | |
echo -n "Full path of where the file is to be saved: "; | |
read saveLocation; |
This file contains 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 | |
# Switch to root | |
sudo su | |
# Update the server | |
apt-get -y update | |
# Install Node.js v7.x: | |
# https://github.com/nodesource/distributions#installation-instructions |
This file contains 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 | |
# https://www.nginx.com/resources/wiki/start/topics/tutorials/install/ | |
# Switch to root | |
sudo su | |
# Add the mainline release | |
echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx | |
deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/nginx.list |
This file contains 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
<?php | |
// Create fake data array of 10000 records | |
$max = 10000; | |
$rands = array(); | |
for($i=0; $i<$max;$i++) { | |
$rands[$i]=mt_rand(0,$max-1); | |
} | |
$temp; | |
// Time foreach itteration |
This file contains 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
@echo off | |
setlocal | |
set DIR=C:\path\from | |
set OUTPUTDIR=C:\path\to | |
for /R %DIR% %%G in (*.jpg *.jpeg) do copy "%%G" "%OUTPUTDIR%" |
This file contains 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
mogrify -format jpg *.jpeg |
This file contains 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
// https://stackoverflow.com/a/7945988/2110294 | |
git diff --diff-filter=M --name-status --no-index /compare/from /compare/to >> some_filename |
This file contains 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
find /path/to -depth -name "*.jpeg" -exec sh -c 'mv "$1" "${1%.jpeg}.jpg"' _ {} \; |