ssh -nNT -L LOCALPORT:DESTINATION:DESTPORT SSHACCOUNT
To forward localhost:5000 to destination.net:80:
# Add this file to ~/.local/share/mime/packages | |
# Run: update-mime-database ~/.local/share/mime | |
<?xml version="1.0" encoding="UTF-8"?> | |
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> | |
<mime-type type="application/x-compressed-tar"> | |
<glob pattern="*.mbz"/> | |
</mime-type> | |
</mime-info> |
#!/bin/sh | |
# Place in /usr/local/bin | |
# Run: chmod +x /usr/loca/bin/phpx | |
echo "<?php var_dump($@);" > /tmp/phpx.php | |
php /tmp/phpx.php |
#!/bin/sh | |
# Place this in /usr/local/bin | |
# Run: chmod +x /usr/local/bin/st | |
exec /opt/sublime_text/sublime_text "$@" |
<?php | |
// Non-associative. | |
$a = [1, 2, 3]; | |
$b = [4, 5, 6, 7]; | |
$c = $a + $b; | |
var_dump($c); | |
$d = array_merge($a, $b); |
# All files, with grep | |
find . -type f -exec cat {} \; | grep -v -E '^\s*(//|\*|\*/|/\*\*|$)' | wc -l | |
# PHP Files, with awk. | |
find . -iname '*.php' -type f -exec cat {} \; | awk '$0 !~ /^\s*(\/\/|\*|\*\/|\/\*\*|$)/{ print $0 }' | wc -l |
-- Find the file ~/.kodi/userdata/MyVideosXX.db | |
-- Open with sqlite3 | |
-- Run the following statement: | |
SELECT | |
m.c00, -- Movie name | |
p.strPath, -- Path | |
f.strFilename -- File name | |
FROM movie m |
# Edit using: | |
# git config -e --global | |
[user] | |
name = Me | |
email = [email protected] | |
[alias] | |
ap = add -p | |
au = add -u | |
bl = branch -l |
Find all the .php files in the current directory and below, and replace FROM with TO.
find . -type f -iname '*.php' -exec sed -i 's/FROM/TO/g' {} \;
/** Using scssphp */ | |
error, pre seriousError, span seriousError, other, hello { | |
border: 1px #f00; | |
background-color: #fdd; } | |
pre seriousError, span seriousError { | |
font-size: 20px; } | |
hello { | |
color: green; } |