Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
NapoleonWils0n / progress bar.css
Created November 1, 2012 20:31
css: progress bar
#progress {
background: white url('progressbar.png') repeat-x 0 0;
}
@webkit-keyframes spin {
from { background-origin: 32px 0; }
to { background-origin: 0 0; }
}
@NapoleonWils0n
NapoleonWils0n / reset.css
Created November 1, 2012 20:31
css: reset
/* Eric Meyer's Reset Reloaded *//* http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ */html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, font, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td {margin: 0;padding: 0;border: 0;outline: 0;font-size: 100%;vertical-align: baseline;background: transparent;}body {line-height: 1;}ol, ul {list-style: none;}blockquote, q {quotes: none;}/* remember to define focus styles! */:focus {outline: 0;}/* remember to highlight inserts somehow! */ins {text-decoration: none;}del {text-decoration: line-through;}/* tables still need 'cellspacing="0"' in the markup */table {border-collapse: collapse;border-spacing: 0;}
@NapoleonWils0n
NapoleonWils0n / brackets.sh
Created November 2, 2012 01:47
bash: brackets
#!/bin/sh
#Square brackets—matches any of a series of characters in a filename.
#For example, ls a[rn]t.jpg matches art.jpg and ant.jpg, but does not match aft.jpg.
#If the first character is a caret (^), it matches every character except for the characters l
ls a[rn]t.jpg
@NapoleonWils0n
NapoleonWils0n / vhost.txt
Created November 2, 2012 00:57
apache: virtual host
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
@NapoleonWils0n
NapoleonWils0n / cd_to_previous_directory.sh
Created November 2, 2012 01:48
bash: cd to previous directory
# cd to previous directory
cd -
@NapoleonWils0n
NapoleonWils0n / list_open_ports.sh
Created November 2, 2012 01:57
bash: list open ports
# List all open ports and their owning executables
lsof -i -P | grep -i "listen"
@NapoleonWils0n
NapoleonWils0n / wp-config Redirect.txt
Created November 2, 2012 00:56
apache: wp-config redirect
Redirect 301 /wp-config.php http://svr.gov.ru
@NapoleonWils0n
NapoleonWils0n / Apache_force_download_in_directory.txt
Created November 2, 2012 00:07
apache: force download in directory
<Directory "/Users/username/Sites/downloads/">
<Files *.mp4>
ForceType video/mp4
Header add Content-Disposition attachment
</Files>
</Directory>
@NapoleonWils0n
NapoleonWils0n / create_directories.sh
Created November 2, 2012 01:53
bash: make a directory including intermediate directories
# Make directory including intermediate directories
mkdir -p a/long/directory/path
@NapoleonWils0n
NapoleonWils0n / opensll_encrypt_files.sh
Created November 2, 2012 02:27
bash: openssl encrypt files
# Generate private and public keys with password.
openssl req -x509 -days 100000 -newkey rsa:2048 -keyout privatekey.pem -out publickey.pem -subj "/"
# Generate private and public keys without password. (add -nodes to the command)
openssl req -x509 -nodes -days 100000 -newkey rsa:2048 -keyout privatekey.pem -out publickey.pem -subj "/"
# Encrypt seemingly endless amount of data.
openssl smime -encrypt -aes256 -in LargeFile.zip -binary -outform DEM -out LargeFile_encrypted.zip publickey.pem
# Decrypt