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
[client] | |
host= | |
user= | |
password= | |
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
source 'https://rubygems.org' | |
ruby '2.0.0' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.0' | |
# Use sqlite3 as the database for Active Record | |
group :development do | |
gem 'sqlite3' | |
end |
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
#List user processes with their memory usage and total usage. | |
ps -u marcanuy -o pid,rss,command | awk '{print $0}{sum+=$2} END {print "Total", sum/1024, "MB"}' | |
#find all file larger than 500M in home dir | |
find ~ -type f -size +500M -exec ls -ls {} \; | sort -n |
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
ps -p <pid> e | cat |
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 | |
$file = new SplFileObject("animals.csv"); | |
$file->setFlags(SplFileObject::READ_CSV); | |
foreach ($file as $row) { | |
list($animal, $class, $legs) = $row; | |
printf("A %s is a %s with %d legs\n", $animal, $class, $legs); | |
} | |
?> |
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/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 | |
/sbin/mkswap /var/swap.1 | |
/sbin/swapon /var/swap.1 | |
#To enable it at the boot time, add the following entry into /etc/fstab: | |
/swapfile swap swap defaults 0 0 |
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 | |
sed 's^\[.*\]^^g' error.log | sed 's^\, referer: [^\n]*^^g' | sort | uniq -c | sort -n |
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
1. my+ 1001. se+ 2001. thedaily+ 3001. empire+ 4001. herb+ | |
2. +online 1002. test+ 2002. giant+ 3002. +cook 4002. +teen | |
3. the+ 1003. fish+ 2003. survey+ 3003. +deluxe 4003. affordable+ | |
4. +web 1004. hk+ 2004. +conference 3004. +crunch 4004. proto+ | |
5. +media 1005. florida+ 2005. twit+ 3005. michigan+ 4005. +ity | |
6. web+ 1006. fine+ 2006. pick+ 3006. cars+ 4006. myhome+ | |
7. +world 1007. loan+ 2007. +dvd 3007. +forest 4007. plastic+ | |
8. +net 1008. page+ 2008. cinema+ 3008. yacht+ 4008. +kc | |
9. go+ 1009. fox+ 2009. desi+ 3009. +wallet 4009. +foot | |
10. +group 1010. +gift 2010. act+ 3010. +contest 4010. +sup |
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
# Gunicorn Site systemd service file | |
[Unit] | |
Description=Gunicorn server for SITENAME-staging.example.com | |
After=network.target | |
After=syslog.target | |
Environment=sitedir=/Development/sites/SITENAME-staging.example.com | |
ExecStart=$(sitedir)/virtualenv/bin/gunicorn --chdir $(sitedir)/source workouts.wsgi:application --bind unix:/tmp/SITENAME-staging.example.com.socket | |
Restart=on-failure |
OlderNewer