Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -out ca.key 2048
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
def compile_asset?(path) | |
# ignores any filename that begins with '_' (e.g. sass partials) | |
# all other css/js/sass/image files are processed | |
if File.basename(path) =~ /^[^_].*\.\w+$/ | |
puts "Compiling: #{path}" | |
true | |
else | |
puts "Ignoring: #{path}" | |
false | |
end |
Use folowing steps to repackage dep package: | |
1: Extract deb package | |
# dpkg-deb -x <package.deb> <dir> | |
2: Extract control-information from a package | |
# dpkg-deb -e <package.deb> <dir/DEBIAN> | |
3. After completed to make changes to the package, repack the deb | |
# dpkg-deb -b <dir> <new-package.deb> |
# Show all grants | |
mysql --skip-column-names -e "SELECT user, host FROM mysql.user" | sed 's/\t/"@"/g; s/^/SHOW GRANTS FOR "/g; s/$/";/g;' | mysql --skip-column-names |
# how to redirect from one port to another using iptables | |
### | |
# install following package in order to preserve the iptables rules | |
sudo apt-get install iptables-persistent | |
# redirect from port 80 to port 8000 | |
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8000 | |
# redirect from one IP to other |
#System wide associations: | |
sudo sed -i 's/gedit.desktop/yournew.desktop/g' /usr/share/applications/defaults.list | |
# Just your user's associations: | |
sed -i 's/gedit.desktop/yournew.desktop/g' ~/.local/share/applications/mimeapps.list | |
# If you're using the PPA for Sublime Text 2, there is already a .desktop file for it | |
# sitting in `/usr/share/applications/` so you can just run: |
#!/usr/bin/env ruby1.8 | |
class Workaround | |
def initialize target_pid | |
@target_pid = target_pid | |
first_child | |
end | |
def first_child |
$ augtool | |
> set /augeas/load/Spacevars/incl[last()+1] "/etc/redis/redis.conf" | |
> load | |
> print /files/etc/redis/redis.conf |
function uuid() { | |
var uuid = "", i, random; | |
for (i = 0; i < 32; i++) { | |
random = Math.random() * 16 | 0; | |
if (i == 8 || i == 12 || i == 16 || i == 20) { | |
uuid += "-" | |
} | |
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16); | |
} |