User:Jonas Lund/the shell
< User:Jonas Lund
Revision as of 09:16, 17 October 2011 by Jonas Lund (talk | contribs) (Created page with "<source lang="bash"> chsh (change shell - default /bin/bash) #Load soundcard driver sudo modprobe snd-pcm-oss #Dump ram to sound card cat /dev/mem > /dev/dsp ls | grep -re ps...")
chsh (change shell - default /bin/bash)
#Load soundcard driver
sudo modprobe snd-pcm-oss
#Dump ram to sound card
cat /dev/mem > /dev/dsp
ls | grep -re
ps aux //check process
| less / grep
#http://commandlinefu.com //lists handy cl stuff
alias pgrep = "ps aux | grep -re $1"
$1, first arg for command line
for 100 dirs at once
for i in $(seq 100); do mkdir folder-$i; done
#see all the paths
echo $PATH
shell vars etc, ENVIRONMENT VARS,
$PATH,$HOME,$USER. $HOST, etc
#tutorials, look for /bin/sh specific to avoid bashism ~ etc..
./ # execute stuff
to run sub-shells
VAR=$(cmd);
for LOOP in VARS
do
//LOOP
if [ $LOOP = "SOMETHING" ]
then
//do stuff
else
//do stuff
fi
done
#threeframes.net
sed 1d //deletes first line of output
#Day 2 - 11th of October 2011
#Markov Chain
#change words in order of appearance
#and output random collections based on % from the source text
cat text.txt | dadadodo -
#pdftotext -> convert pdf to text
<<EOF //escape chars
#Text Synth!
cat text.file | dadadodo - | festival --tts
#mbrola / synthesizer dict better
#ices2 / icecast server - broadcast radio
#Random Generator
/dev/urandom > /dev/dsp = white noise!
#ACSII TABLE / Based on 256;
#(mapping of chars encoded into binary)
==Operators in C==
AND, returns 0 or 1
&
OR
|
XOR
^
>>n = bitshift right, n=how many bits to shift
<<n = bitshift left
#most amazing shiftop ever
't*(t>>5|t<<5|t>>6|t<<6)'
#rising star
't*(t>>5|t<<5|t>>8|t<<8) | t*(t<<4) & 45 | t*(t>>12)
#bulding up star
'((t>>1)^(t>>6))|((t>>1)^(t>>7))+t*(t>>13)'