Difference between revisions of "Main Page"

From PaskvilWiki
Jump to: navigation, search
Line 47: Line 47:
  
 
* Extensions and File Name
 
* Extensions and File Name
* ''General Tricks'':
+
* ''Commands and Shortcuts'':
 
<pre>$ sudo !!                        - run last command as root
 
<pre>$ sudo !!                        - run last command as root
 
$ !!:gs/foo/bar                  - run last command, replacing 'foo' with 'bar'
 
$ !!:gs/foo/bar                  - run last command, replacing 'foo' with 'bar'
Line 56: Line 56:
 
$ > file.txt                      - empty a file
 
$ > file.txt                      - empty a file
 
<Alt+.>                          - put last argument on cursor place; repeat to cycle through
 
<Alt+.>                          - put last argument on cursor place; repeat to cycle through
$ mount | column -t              - pretty-print mount table
 
$ netstat -tlnp                  - print all listening ports with PID's
 
$ mount -t tmpfs tmpfs /mnt -o size=1024m      - mount temporary RAM partition (fast access, non-persistent!)
 
 
$ (cd /tmp && ls)                - jump to /tmp, execute ls, and jump back here
 
$ (cd /tmp && ls)                - jump to /tmp, execute ls, and jump back here
$ disown -a && exit              - exit the shell while keeping all running processes alive
 
 
$ pushd /tmp .... $ popd          - goes to /tmp, remembering current location; at later time, popd will bring you back
 
$ pushd /tmp .... $ popd          - goes to /tmp, remembering current location; at later time, popd will bring you back
$ cat /etc/issue                  - display distro name
 
 
$ \command                        - run command without using aliases
 
$ \command                        - run command without using aliases
 
$ rm !(pattern|pattern)          - delete files that do not match given patterns
 
$ rm !(pattern|pattern)          - delete files that do not match given patterns
 +
<Ctrl-u> ... <Ctrl-y>            - Ctrl+u will kill (cut) current command, then you can do whatever you need, and Ctrl+y will paste (yank) the line back
 +
$ date -d @1234567890              - convert unix timestamp to human-readable</pre>
 +
* ''Informations'':
 +
<pre>$ mount | column -t              - pretty-print mount table
 +
$ cat /etc/issue                  - display distro name</pre>
 +
* ''Small Tricks'':
 +
<pre>$ mount -t tmpfs tmpfs /mnt -o size=1024m      - mount temporary RAM partition (fast access, non-persistent!)
 +
$ disown -a && exit              - exit the shell while keeping all running processes alive
 +
$ ssh -t remote_host screen -r    - directly connect to a remote screen process
 +
$ for I in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $I | gzip > "$I.sql.gz"; done
 +
                                  - backup all databases into individual files
 
$ fuser -k filename              - kill process that is locking given file
 
$ fuser -k filename              - kill process that is locking given file
 
$ readom dev=/dev/scd0 f=/path/to/image.iso    - create CD/DVD ISO image
 
$ readom dev=/dev/scd0 f=/path/to/image.iso    - create CD/DVD ISO image
 
$ mkdir -p a/deep/dir/tree        - create nested directories fast
 
$ mkdir -p a/deep/dir/tree        - create nested directories fast
 
$ mount file.iso /mnt/iso -o loop - mount ISO file as drive /mnt/iso (dir has to preexist)
 
$ mount file.iso /mnt/iso -o loop - mount ISO file as drive /mnt/iso (dir has to preexist)
$ sudo touch /forcefsck          - force a file system check on the next reboot
+
$ sudo touch /forcefsck          - force a file system check on the next reboot</pre>
$ for I in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $I | gzip > "$I.sql.gz"; done
+
                                  - backup all databases into individual files
+
$ ssh -t remote_host screen -r    - directly connect to a remote screen process
+
<Ctrl-u> ... <Ctrl-y>            - Ctrl+u will kill (cut) current command, then you can do whatever you need, and Ctrl+y will paste (yank) the line back
+
$ vim +10 [file] ; vim +/hello [file]          - open [file] at line 10, or at first occurrence of pattern 'hello' in file
+
date -d @1234567890              - convert unix timestamp to human-readable</pre>
+
 
* ''lsof'':
 
* ''lsof'':
<pre>$ lsof -nPi                      - list network connections; similar to `netstat -plnt` (run as root to see all process names)
+
<pre>$ lsof -nPi                      - list network connections
 +
$ netstat -tlnp                  - print all listening ports with PID's (run as root to see all process names)
 
$ lsof -c gnome-terminal          - list files opened by given command
 
$ lsof -c gnome-terminal          - list files opened by given command
 
$ lsof +D [folder]                - discover all open files in the [folder]
 
$ lsof +D [folder]                - discover all open files in the [folder]
Line 123: Line 124:
 
* Directly type HTML entities
 
* Directly type HTML entities
 
* Reformat a plain text paragraph
 
* Reformat a plain text paragraph
<pre>$ vim -x filename                   - open filename for editing, and save it encrypted (will prompt for a key)
+
<pre>$ vim -x filename                     - open filename for editing, and save it encrypted (will prompt for a key)
:X                                 - set encryption for current file; use ':set key=' to disable encryption
+
:X                                     - set encryption for current file; use ':set key=' to disable encryption
                                    - put "set cm=blowfish" in your .vimrc to enable safer encryption by default</pre>
+
                                      - put "set cm=blowfish" in your .vimrc to enable safer encryption by default
 +
$ vim +10 [file] ; vim +/hello [file]  - open [file] at line 10, or at first occurrence of pattern 'hello' in file</pre>
  
 
=== [[Short Notes on Web|Web - HTML, CSS, JS, jQuery, etc.]] ===
 
=== [[Short Notes on Web|Web - HTML, CSS, JS, jQuery, etc.]] ===

Revision as of 08:37, 6 September 2012

Welcome to the PaskvilWiki!

The future shape of this wiki is unknown for now, let's hope it'll be something good...

This is partially a private wiki - viewing is allowed to all, but editing is allowed only to registered users.

This is more of a prevention than denial - I don't have time to monitor and moderate edits; - you're more than welcome to request registration, all contributors are very much welcome!

Just write me at josef.at.paskvil.dot.com.

SVN

Simple Guide to SVN Client

Bullets on how to use SVN client.

Creating a SVN Repository

How to create a new SVN repository to serve using svnserve, via svn+ssh or via Apache.

Moving a SVN Repository

Moving complete SVN repository from one host to another.

Setup a SVN Server on a Shared Hosting

How to setup SVN hosting (via svn+ssh) if you're on a shared hosting client - no root access.

References and Tutorials

Emacs and Slime Reference

Small jQuery Reference

Small jQuery Cheat Sheet

Small SPARQL, RDQL, etc. Cheat Sheet

Small 4store How-To

Short Notes - Tips and Tricks

Apache

  • Note on serving of local files
  • Self-Signed SSL Certificate
  • Enable SSL/HTTPS in Apache
  • .htaccess and mod_rewrite Tricks

Bash

  • Extensions and File Name
  • Commands and Shortcuts:
$ sudo !!                         - run last command as root
$ !!:gs/foo/bar                   - run last command, replacing 'foo' with 'bar'
$ ^foo^bar                        - run last command, replacing 'foo' with 'bar'
$ cp filename{,.bak}              - create a .bak copy of file
<Ctrl-x> <Ctrl-e>                 - open $EDITOR to edit current command line; upon exit, content will be run
$ <space>command                  - run the command without saving it in history
$ > file.txt                      - empty a file
<Alt+.>                           - put last argument on cursor place; repeat to cycle through
$ (cd /tmp && ls)                 - jump to /tmp, execute ls, and jump back here
$ pushd /tmp .... $ popd          - goes to /tmp, remembering current location; at later time, popd will bring you back
$ \command                        - run command without using aliases
$ rm !(pattern|pattern)           - delete files that do not match given patterns
<Ctrl-u> ... <Ctrl-y>             - Ctrl+u will kill (cut) current command, then you can do whatever you need, and Ctrl+y will paste (yank) the line back
$ date -d @1234567890               - convert unix timestamp to human-readable
  • Informations:
$ mount | column -t               - pretty-print mount table
$ cat /etc/issue                  - display distro name
  • Small Tricks:
$ mount -t tmpfs tmpfs /mnt -o size=1024m      - mount temporary RAM partition (fast access, non-persistent!)
$ disown -a && exit               - exit the shell while keeping all running processes alive
$ ssh -t remote_host screen -r    - directly connect to a remote screen process
$ for I in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $I | gzip > "$I.sql.gz"; done
                                  - backup all databases into individual files
$ fuser -k filename               - kill process that is locking given file
$ readom dev=/dev/scd0 f=/path/to/image.iso    - create CD/DVD ISO image
$ mkdir -p a/deep/dir/tree        - create nested directories fast
$ mount file.iso /mnt/iso -o loop - mount ISO file as drive /mnt/iso (dir has to preexist)
$ sudo touch /forcefsck           - force a file system check on the next reboot
  • lsof:
$ lsof -nPi                       - list network connections
$ netstat -tlnp                   - print all listening ports with PID's (run as root to see all process names)
$ lsof -c gnome-terminal          - list files opened by given command
$ lsof +D [folder]                - discover all open files in the [folder]
$ lsof -p [pid]                   - list files opened by given PID
$ lsof -i :8080                   - list programs that have port 8080 open ("who to kill" if you get "port already in use")

C/C++

  • How to clean up after child thread
  • Non-blocking IO using sockets

ffmpeg

  • Rip DVD into FLV (or anything else)

Linux Administration

  • Reset Compiz to Default Settings
  • Enable and Start sendmail
  • Installing sendmail
  • Sending Emails using sendmail

PDF

  • Merging PDF Files using GhostScript
  • Cutting PDF Files using GhostScript
  • Converting to PDF using GhostScript

PHP

  • Convert Accented Characters to Non-Accented
  • Upload a File using cURL

Python

  • Timing, and memory, on Linux

Security

  • Password Generators

ViM

  • Delete all lines matching a pattern
  • Directly type HTML entities
  • Reformat a plain text paragraph
$ vim -x filename                      - open filename for editing, and save it encrypted (will prompt for a key)
:X                                     - set encryption for current file; use ':set key=' to disable encryption
                                       - put "set cm=blowfish" in your .vimrc to enable safer encryption by default
$ vim +10 [file] ; vim +/hello [file]  - open [file] at line 10, or at first occurrence of pattern 'hello' in file

Web - HTML, CSS, JS, jQuery, etc.

  • Multiple Submit Buttons and/or Multiple Forms on Page
  • Make 'float' Elements Appear One under Another
  • Upload a File via Form
  • Override the IE's Problem with width
  • Make an Element Fill In All the Remaining Space

Other Short Notes

Rip Video DVD that is not Finalized

Install Apache and PHP to do Secure h264 Pseudo Streaming