From wikistone
Jump to: navigation, search
Line 6: Line 6:
 
* [[NTP]] goodness lies here.
 
* [[NTP]] goodness lies here.
 
* [[shell]] stuff
 
* [[shell]] stuff
−
 
−
==shell==
 
−
===regex===
 
−
* <nowiki />* any char
 
−
* ? single char
 
−
* [characters] all chars
 
−
* [!characters] not all chars
 
−
* <nowiki>[[:class:]]</nowiki> specified class
 
−
** [:alnum:]
 
−
** [:alpha:]
 
−
** [:digit:]
 
−
** [:lower:]
 
−
** [:upper:]
 
−
examples:
 
−
{| class="wikitable"
 
−
|-
 
−
! pattern !! match
 
−
|-
 
−
| a*b || a, any # chars, b
 
−
|-
 
−
| poo??? || poo then any 3 char
 
−
|-
 
−
| [abc] || an a, b, or c
 
−
|-
 
−
| poo.[0-9][0-9][0-9] || poo. then any 3 #
 
−
|-
 
−
| <nowiki>[[:upper:]]*</nowiki> || any beginning with an upper
 
−
|-
 
−
| <nowiki>[![:digit:]]*</nowiki> || any not beginning with a digit
 
−
|-
 
−
| <nowiki>*[[:lower:]123]</nowiki> || <nowiki>and ending with lower or 1|2|3</nowiki>
 
−
|}
 
−
 
−
===find===
 
−
====by size====
 
−
find files at least _kb in size:
 
−
<pre>$ find {/path/to/directory/} -type f -size +{size-in-kb}k -exec ls -lh {} \;</pre>
 
−
Example (50 megs):
 
−
<pre>$ find / -type f -size +50000k -exec ls -lh {} \;</pre>
 
−
RedHat / CentOS / Fedora
 
−
<pre>$ find {/path/to/directory/} -type f -size +{size-in-kb}k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' </pre>
 
−
Debian / Ubuntu
 
−
<pre>$ find {/path/to/directory} -type f -size +{file-size-in-kb}k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }' </pre>
 
−
 
−
===std in, out, & err===
 
−
* 0 : in
 
−
* 1 : out
 
−
* 2 : error
 
−
====redirection====
 
−
out
 
−
<pre>$ [command] > [dump_location]</pre>
 
−
err
 
−
<pre>$ [command] 2> [dump_location]</pre>
 
−
out & err old way
 
−
newer way
 
−
<pre>$ [commnad] > [dump_location] 2>&1
 
−
$ [commnad] &> [dump_location]</pre>
 
−
append std to dump_location
 
−
<pre>$ [command] >> [dump_location]
 
−
$ [command] &>> [dump_location]</pre>
 
−
 
−
 
−
===repeat a function===
 
−
Add this to ~/.bashrc for persistance.
 
−
<pre>function repeat { while 1 ; do "$@" ; sleep 1 ; done; }</pre>
 
−
 
−
===watch a command===
 
−
<pre>watch -n # [command]
 
−
# -> interval</pre>
 
  
 
==Arch==
 
==Arch==

Revision as of 10:03, 7 December 2013


General

  • AD integration
  • iptables
  • NTP goodness lies here.
  • shell stuff

Arch

How to install packer.

.