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
Takes a long time to load project folders running in a VM and the sublime console shows: | |
inotify_add_watch failed: No space left on device (path: /some/project/location/...) | |
https://github.com/google/cadvisor/issues/1581#issuecomment-367616070 | |
sudo cat /proc/sys/fs/inotify/max_user_watches # default is 8192 | |
sudo sysctl fs.inotify.max_user_watches=1048576 # increase to 1048576 | |
https://github.com/google/cadvisor/issues/1581#issuecomment-436405681 |
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"' _ {} \; |
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
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
@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
<?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
#!/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
#!/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 | |
# 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 | |
# 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 |