special chars
[] bracket expression
match any one character of the given
b[aeiou]g bug bag big beg bog
[-] range expression
a[2-4]z a2z a3z a4z
.
a.z any letter or number can be the dot
^ start of line
$ end of line
. repetition of the matched item
escaping characters in regular expressions
filename\.txt
file archives
collect groups of files to move them around
tar, zip
tar - tape archive
compressed as "tarball"
zip gzip bzip2 xz
zip programs
gzips gunzip
bzip2 bunzip2
xz unxz
.tgz tarball compressed with gzip
tbz tarball compressed with bzip
txz
grep -E '[aeiou]{2,}' fruitstand.txt
find ocurrences of two neighboring vowels
grep -E '2.+' fruitstand.txt
find 2 and something following, but not as last character
grep -E '2$' fruitstand.txt
looking for 2 at the end of the line
grep -E 'is|go|or' fruitstand.txt
search for any of these substrings / letter combinations in the file
slice it and dice it to find things in logfiles
grep -E '^[a-l]' fruitstand.txt
select lines beginning with lowercase a to l
grep -E '^[^flt]' fruitstand.txt
select everything that does NOT begin with f, l or t
kernel = low level computer program, bridge between user and computer resources
memory, input, output
rolling releases ... system is constantly updated
usecase embedded systems for linux
arduino, raspberry pi
small footprint, highly customizable
android is sort of a linux
and it's fucking everywhere
LTS long term support version
distros are installed as .iso files
or write your .iso to a bootable usb drive
free virtualization software virtualbox - use it to play with the install procedure
keep your system up to date to have it secured
type in the virtual system into terminal:
sudo apt install linux-headers-$(uname -r) build-essential dkms
then have guest addons installed via script
linux less than 2% end user market share... why?
available free, it's secure, runs on any hardware ....
mac os runs only on mac hardware.
windows has ms dos terminal
mac has terminal
linux has shell
open source software is a great example of open collaboration
android is an embedded operating system variant of linux that is used in smartphones, tablets and tv's
hcl hardware compatibility list
preemptive multitasking is a task in which a computer operating system uses some criteria to decide how long to allocate to any one task before giving another task a turn to use the operating system. the act of taking control of the operating system from one task and giving it to another task is called preempting.
open source software advantages
scalability, security, affordability, transparency, interoperability
source code - human readable form of machine process
in open source, cost is distributed differently
nevertheless, you can donate or pay for certain specific implementations.
wireshark network analyzer
gparted partition editor
timeshift backup tool
atom text editor with version control system integration
putty ssh gui
javascript files
index.html - > script.js
referenced via
!!!script
python files
interactive environment takes python commands
also executed via shell files
php files
php
java
compiled language
classes are compiled into executable binaries
java "ExecutableClass"
executes the file
stylesheets
css styles html pages
change look and feel of a web site
link rel="stylesheet"
c++
compiled language
lower level programming language
g++ compiler
g++ -o hello helloworld.cpp
./hello
go
newer object oriented language
compiled language
c
low level programming language
predecessor of c++
gcc helloworld.c -o hello
./hello
c#
ruby
hello_world.rb
interpreted or scripted
interactive ruby environment
irb
repositories contains specifically compiled packages for distro
command line can be quicker for some use cases
desktop environments are interchangeable
ubuntu is so slick and eyecandy )))
linux desktops are highly configurable
flexible support for word processor formats, cross compatibility
anything that works on windows or mac, also works on linux
bash acts as a shell program in the command line
terminal emulator / terminal lets user interact
there are quite a bunch of emulators...
and tons of commands they accept
ls list
cp copy
cd change directory
mv move file
rm delete / remove file / dir
man manual
mkdir make directory
rmdir remove directory
touch create a file
locate find a file
clear clear screen buffer
software packages have dependencies, often ship with instructions
.deb .rpm .tgz
debian derived distros
red hat linux system
tarball universal linux format
package managers try to resolve dependencies automatically
and updates
dpkg apt rpm yum dnf
apt yum pacman dnf
each distro has its own package structure
windows and mac os desktop environments are unseparable,
while linux makes it possible to choose one
the kernel directly controls hardware and translates the commands given from a piece of software into something the hardware can understand and act upon
terminal programs are used to access the shell
the application packaging is different for each distro family
telnet or ssh allows remote login to a shell
each user can define default shell
and default terminal gui program
terminal shortcut ctrl alt t
computer waits
user enters command
computer executes
command - char sequence
inspired by english language
syntax is crucial
command parameters switches
options switches start with a dash
-a -c is the same as -ac
long options start with two dashes --help
commands don't have leading dashes
command options arguments
shell automates things with shell scripts
shell script - file containing a series of commands
variables must start with a letter
must not contain whitespaces
punctuation marks are not allowed
printenv lists all available variables
environmental vars are all UPPERCASE
meta-characters are e.g. blanks and spaces
dollar
star
semicolon
ampersand
meta-characters must be quoted to prevent the shell from interpreting them as such
double quotes, single quotes, backslash are ways to quote
or turn off special char capabilities
echo Hello\; World
echoes
Hello; World
echo "I have \$1200"
echoes
I have $1200
pwd print working directory
ls list directory contents
touch create empty file
touch text1.txt
ls can show additional info
ls -la
echo Hello; ls
does both commands.
\ escapes one character
"" escapes a whole string
man pages explain usage of commands
what arguments and syntax they accept
keyword search on the man pages:
man -k keyword
ls -a
ls --all
shorthand and longhand version of the command
both do the same thing
info are like man pages but much more detailed
info
p previous
n next
q quit
quoting is the generic name given to the action of protecting shell meta characters from being treated specially by the shell
root of file system - topmost directory
something like the c: drive
root user
super user with full system access
windows uses backslashes
linux uses slashes
/home/username/letters
c:\my documents\letters
windows detects drives during the boot process
linux mounts and unmounts devices
on bootup drives can be mounted automatically
filenames are case sensitive on linux
on windows, filenames are not case sensitive
files in linux do not need to have a file extension
windows and linux has normal and hidden files
hidden files are not shown by default
on linux, only the owner of a file or dir can grant access
access permissions are read write execute
directory layout is somewhat standardized
fhs filesystem hierarchy standard
shareable unshareable static variable files
linux uses forward slash as dir separator
pwd print working directory
absolute references /
home dir references ~/
relative references filename/path/to/somewhere
hidden subdirs . ..
. this dir
.. parent dir
cp copies files
cp source dest
cp [OPTION] source dest
mv move and rename files
linux can link one file as multiple links
hard link
symbolic link
hard link
duplicate dir entry for the same file
ln origname linkname
symlink
refers to another file by name
ln -s origname linkname
in windows the only thing like this is "create desktop shortcut"
symlink is a new name for a file that already exists
wildcard - a symbol that stands for other characters
"globbing"
b??l ... bowl, ball, bool, ....
asterisk - will match any character
b**l ...
bracketed value [ ]
b[ao][lw]l ... bowl, ball, NOT bull!
careful with wildcards!!!
linux is case sensitive!
therefore grep -ri exists
in windows, they don't treat things with case sensitivity
linux filesystems are case sensitive
win filesystems under linux are case insensitive
FAT NTFS ... cross platform compatibility can depend on case sensitivity
rmdir only removes empty dirs
rm -r removes everything, recursive delete
directories are just special files
a file that holds other files
touch used with a dir updates dir's time stamp
mv uses dirs or files
ln -s can link to a dir
hidden files have a dot as first character
ls ba??.txt
lists everything starting with "ba" and two more chars
and the ending ".txt"
globbing is using for certain things,
while you slice and dice the information
using ?? ** [] expressions
pipe |
output of first command into stdin of second command
grep searches for keywords ....
find specified strings and return filename
grep takes regular expressions
input / output redirection :
xargs generate command line options from programs outputs
> creates new file containing stdout
>> concatenates existing files, adds at the end
2> creates new file with std errors
2>> appends std errors to file
&> creates new file with stdout and stderr
< uses as stdin
<< looks up the following as stdin
<> specified file as stdin and stout
stdout
stderr
stdin
/dev/null is a trashcan device
ls > myoutput
cat myoutput
wc word count
wc -l counts lines
< emulates input from a file as if it came from the keyboard
ls video.mpeg blah.foo > myoutput 2>&1
2>&1 what is &1 ? stdout
head -3 give me the first three things!
ls | head -4 give me the first four listings!
ls | tail -2 last 2!
<< operator allows the user to accept text on the following lines as standard input
basic and extended regular expressions
the ^ represents the start of a line,
the $ represents the end of a line
conf and log files are text files
vi nano emacs
nano is a clone of pico,
more lightweight than emacs
vi commands
^ get me to the start of the line
w jumps word forward
3w jumps 3 words forward
3b jumps 3 words back
set nu adds line numbers
: enters command mode
shell script must be executable
scripts are able to run commands
& ampersand allows multiple commands to be launched
otherwise the script waits for programs to finish
find locates files
echo displays messages
$0 name of script
$1 first param
$2 second param ....
vars can also be assigned inside the script
$variable
errors are bugs
valuable system commands:
hostname date uptime
use logic in shell scripts to handle errors
conditional expressions
if
if [-f file]
if [-s file]
if file is greater than zero
if [string1==string2]
&& and || operators
logical and , logical or
and : both sides of condition must be true
or : one side of condition must be true
if [ -s /tmp/tempstuff ]
then
echo "/tmp/tempstuff found; aborting :-("
exit
fi
if [condition]
then
bla
else
otherbla
fi
case word in
pattern1) commands;
pattern2) commands;
for loops
for d in '/bin/ls .wav';
do aplay $d
done
seq loops
seq 1 10
seq 1 2 10
increments by 2
while loop
as long as condition is true, do thins
until
executes until some condition is met
functions
myfn() {
commands
}
keyword function may optionally precede the function name
function myfn() {
commands
}
exit causes immediate termination of script
scripts have exit values
numeric values between 0 - 255
$termcause = 0
exit $termcause
exit with errorcode to the user or the follow up script
by convention, environment variable names are all uppercase.
a running program is called a process
packages vary between distros
each package is a single file
packages are somehow like compressed folders
packages contain version info and can have dependencies
architecture information
packages are not necessarily binaries, can also contain sourcecode
package managers resolve dependencies, so you install
whole dependency trees
command to install
dependency location
user approval
download and installation
package management requires root access
deb package manager apt
dnf is modernized yum, fedora
yum still used by centos
it's good to keep the package manager updated weekly...
package managers can search and install from the command line
apt search chrome
apt remove package
sudo apt autoremove
security: uninstall unused programs
apt show package
shows info about package
you don't need to build ten packages from source before using your target package
the package manager does it
on servers, there is no gui - so you must use package managers from the command line
kernel manages memory, hardware, devices....
kernel calls init process
init calls logins ... etc
children of init
parent process that launched a process
child process
processes form a tree of parents and their children
processes have PID s .... process id's
and PPID parent process's id
ps lists processes
top process table with active processes at the top
free shows mem usage
ps ax | grep gedit
use pipe to look for specific processes
top
dynamic realtime view of a running system
ps
information for a single moment in time
top is interactive ps
load average shows hung up processes
if necessary kill or stop processes using pid number
sorting by memory shows memory leaks
free shows overall memory use
mem - total ram statistics
used - free - total memory
swap - is used as addition to physical ram if not enough memory available
logfiles daemons
daemons write logfiles
/var/log
common dir for logfiles
boot.log
summarizes start of services late in the boot process
cups/
print services
gdm/
syslog general purpose logfile
secure security related log
Xorg.0.log
X window system logfile
logs are frequently rotated
old ones are deleted, new ones created
syslog / syslogd
started during boot process
kernel logging
klog / klogd
the kernel ring buffer
stored in memory
its contents are continuing to change
while the computer runs
dmesg shows kernel ring buffer messages
diagnosing hardware and driver problems
can be redirected to log file to avoid missing things that fall out of the buffer
the package system is installed as part of the distro by default
what to do if networking is not automatically setup!
domain name system
"the internet phonebook"
example.com -> ip number
dhcp
gain config info from another computer automatically
ethernet
wired network hardware
wireless uses ethernet technique over the are
hostnames ... make computer names memorable
you don't have to memorize numbers.
internet - net of nets
tcp - ip
ip address - phone number for a computer
ip internet protocol
computers communicate via ip addresses
IPv4 four byte addresses
IPv6 six byte addresses
netmask
network portion - computer portion of address
subnet mask
router - connects two ore more networks together
"gateway"
single device for switch router modem in one ...
tcp/ip is a set of standards
transmission control protocol / internet protocol
wi-fi wireless networking
creating a network connection
assigning ip address and netmask
netmask / subnet mask denotes the same
dhcp server sends automatic configuration
ip addresses fixed / dynamic
your computer gets the same ip every time
your computer gets a different ip every time
777 read write execute for everyone
750 owner has full permissions, group can read and execute
644 owner can read / write, group and world can read
400 owner can read, group and world have no permissions
symlinks always have 777
whether you can create files depends on the directory permissions you're in
root even writes 000 files ))
muhaha
umask determines default permissions for new files
666 .... the number of the beast
-rw-rw-rw-
special files
directories are special filetypes
create or delete a file depends on directory permissions
sticky bit set on directory
user may only delete own files or files stored in own directory
octal code for sticky bit
1755
sets sticky bit
0755
removes sticky bit
chmod o+t
set sticky bit on subdir
chmod o-t
remove sticky bit on subdir
suid
set user id
run the program with permissions of file owner
rather than with the permissions of user who runs the program
sgid
set group id
set the group of the running program to the group of the file
chmod stuff
4 sets suid bit
2 sets sgid
6 sets both bits
u+s sets suid
g+s sets sgid
ug sets both
hidden files on linux have filenames prepended with a .
dotfiles
configuration files
ls -a
shows hidden files and directories
.
current directory
..
parent directory
permissions
r = 4
w = 2
x = 1
chmod 777 foo1.txt
everyone can do everything
chmod 1644 foo1.txt
set sticky bit of foo1.txt
see the "T"
-rw-r--r-T 1 ptero ptero 0 Jan 10 16:28 foo1.txt
chmod 0644 foo1.txt
unset the sticky bit
octal code 644
symbolic code rw-r--r--
dotfiles are hidden from the ls command, unless option -la is used
hard link contains the data in the target file
soft link does not
man page sections can be
NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
SEE ALSO
OPTIONS
EXIT STATUS
RETURN VALUE
ENVIRONMENT
BUGS
FILES
AUTHOR
REPORTING BUGS
HISTORY
COPYRIGHT
mkdir "dir1 dir1"
creates a directory named dir1 dir1
...useless as it may seem ...
single and double quotes are supported
/proc is a virtual or pseudo filesystem used to interface with the kernel and processes
tty is a name for a terminal connection
tail -c NUM
output the last NUM bytes of file
useradd -M
--no-create-home
which option of the command history can be used to clear the user's history?
history -c
what is a requirement of the gpl license but not the bsd license?
users who modify and distribute the software under the gpl license must make the modifications they made available to the recipients under the same license.
which command can be used to resolve a dns name to an ip address?
host
what is gpl, must stay gpl
in order to stay open source
which file on a linux system is modified to set the maximum number of days before a password must be changed?
/etc/shadow
Yeeeehah ... ccgt reaches version 1.0 and is available on github. Big thanks to Izzy for all your support! I will be the proud owner of your Inofficial Android Handbook in a few days ))
ccgt version 0.85 is out now .... check out the sourcecode on github. now pitch detection is done using the yin algorithm developed by Joren Six, Olmo Cornelis and Marc Leman. a great thank you !!!!
instead of just doing fft, the yin algorithm detects fundamentals with way less error... you can try with your low e-string
ccgt is now working on the android platform. You should be able to install it if your phone is not too old, minimum sdk version for the app is 23, target sdk version 29. In the beginning there was just the console. The code was just there and worked straightforward in c using ncurses. Still the ui simply uses characters, but now in a different world where threads rule. In the sinewave clock project below, the problem of manipulating the ui while in another thread was solved. Here, a handler posts the display update Thread as a Runnable twice a second.
Up to here, the code is about as easy to follow as Bjoern Roche stated. It is usable, but has some flaws in it which makes performance poor for certain conditions. So the next goal will be optimization.
Guys, it's not just the fft ... you get a screenshot of the audio and some frequencies out of it. But in the end it's just a sequence of numbers ... telling you not too much about what's happening in front of your mic. The code already uses windowing and a lowpass filter on the input, and an additional moving average on the output. But still the display is somewhat chatty and not always on the correct fundamental. Further investigation is needed into how frequency peaks are to be found.
So now the Sinewave Clock has gone to the Android Platform. It looks better than in SWT Here's the sourcecode ..... Basically, a analog clock with rotating pointers is displayed. A LineChart below shows the y - height of the seconds pointer using MPAndroidChart library - thanks so much PhilJay!
Here you find a Clock Program, written in Java in Eclipse. It displays a line denoting the ongoing seconds on the one hand; and derived from the height of the seconds pointer a sinewave flowing to the right. Have fun testing it
Some of you may have met the famous app guitar tuna, which is awesome for tuning guitars.... you see your pitch changing over time, displayed as a downward flowing histogram of pitch. Why not?
This program is a fork of Bjorn Roche's guitartuner,
with added pitch histogram. Thanks Bjorn, this helped me a lot !°!!!!!!!! It is supposed to be somewhat intuitive .... running in a linux console. If you like it, you should buy Bjorn a cup of coffee