Welcome To Snipplr
Everyone's Recent Bash Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
"-b" and "-a" tells grep to show you 10 lines before and 10 lines after
0
732
posted 16 years ago by lakedenman
Execute this to remove the .svn directory from the current directory and all sub directories
3
831
posted 16 years ago by meinhard
This is meant to be run as root, so do it at your own risk. It's very raw and needs error checking, but works. I run this script to get new django sites off the ground in a few minutes.
0
1516
posted 16 years ago by mandric
Start mplayer with -vf screenshot, and press 's' when you want to capture a
frame.
0
736
posted 16 years ago by mandric
Check out the bash command 'shopt -s cdable_vars' From the man bash page: If set, an argument to the cd builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to.
0
695
posted 16 years ago by cczona
(EDITED: Originally I had this snip using 'cat /proc/version'. But have since replaced it with a more reliable -- and specific -- method)
If you need still more info (or are on a BSD), see 'uname', 'dpkg-architecture'
1
680
posted 16 years ago by cczona
If Ubuntu Server fails to resolve hostnames or find a network connection via Parallels 3 bridged networking, it may be attempting to use the wrong network interface.
0
745
posted 16 years ago by cczona
Quick command I use to remove .SVN folders from a tree structure copied from SVN working copy. Sometimes a bit easier than running an export.
6
1408
posted 16 years ago by wfdev
find command just returns a list of HTML files that have 'search_str' in it, vim takes a list of files.
0
803
posted 16 years ago by mandric
count .htm or .html files in the directory.
use ls and grep command.
1
746
posted 16 years ago by kyokutyo
recover to normal speed with
/sbin/ipfw delete 100
/sbin/ipfw delete 200
... or reboot
0
956
posted 16 years ago by zingo
Useful when trying to cleanup a large repo to see where you've made the most changes
1
1421
posted 16 years ago by JacobSingh
Forces a recalcitrant port to install by *uninstalling* it completely first
0
507
posted 16 years ago by cczona
//for options available, see:
http://www.ss64.com/bash/shopt.html
1
854
posted 16 years ago by cczona
Sure that programmers know this, but me as a sysadmin does not use svn that much.
3
1126
posted 16 years ago by therobot
This command will not delete the .DS_Store files from the file system, just take them out of version control.
Before doing this it would be a good idea to setup the repository to ignore .DS_Store files.
1
1656
posted 16 years ago by jachin
\Q...\E perl quoting means no ugly escaping in the regex. find's -print0 with xargs -0 is the secret to handling files with spaces in their names.
1
1134
posted 16 years ago by ches
Il suffit de créer une page PHP et y placer un phpinfo() ou si vous avez accès au serveur en ligne de commande (Putty, WinSCP, ...), vous pouvez tapez cette commande. Dans l'exemple, nous souhaitons savoir si l'extension openssl est présente et no...
0
775
posted 16 years ago by cyo
This script removes (DROPS) all tables that start with foo_. Usefull if you had some CMS or application that (ab)uses table prefixing, and want to clean 0ut your database.
NOTE: the data is remove FOREVER! So take good casre: make backups and all...
2
1017
posted 16 years ago by berkes