centralization versus decentralization

Both of them, centralized and decentralized systems, have their unique strengths, advantages, and peculiarities. In this examination, I’ll dive into both concepts. It was an IT related issue that encouraged me to get in touch with this issue, but the concepts and thoughts can be applied to almost every area. None of both is a better nor superior concept. It depends on the specific situation if centralization or decentralization is a better match. In reality, you will often find a combination…

0
Read More

Monitoring network traffic

tcpdump You want to track all incomming http-Headers on your Webserver? sudo tcpdump -A -s 10240 ‚tcp port 80′ | egrep –line-buffered „^……..(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: “ | sed -r ’s/^……..(GET |HTTP\/|POST |HEAD )/\n\1/g‘ Show the HTTP Requests only: sudo tcpdump -A -s 10240 ‚tcp port 80′ | egrep „^……..(GET |HTTP\/|POST |HEAD )|^[:alnum:]+: “ | sed -r ’s/^……..(GET |HTTP\/|POST |HEAD )/\n\1/g‘ capture for a specific URL string (only inside the url’s path) sudo tcpdump -s0 -A -vv | grep „myPathString“…

0
Read More

dealing with local mta

MTA stands for „mail transfer agent“. Popular ones are sendmail, exim and postfix. If you want to know what MTA is running locally you can check which program listens on port 25: lsof -i :25 You might also telnet on port 25 and let the MTA himself respond who he is: telnet localhost 25   For configuring exim4 the preferred way is to use the graphical interface, call it with: dpkg-reconfigure exim4-config    

0
Read More

mssql-check-connection

Easiest way to check a connection for a MSSQL database: Create a file called : myfile.udl Paste the following content (make sure to use your settings): [oledb] ; Everything after this line is an OLE DB initstring Provider=SQLOLEDB.1;Persist Security Info=False;User ID=myUsername;Data Source=100.200.3.4;Password=myPassword  

0
Read More

show word occurence in pdfs on commandline

Do you want to know how often words occur in a pdf file? And sort them by the most occurring word: pdftotext mypdf.pdf – | sed „s/[[:cntrl:][:digit:][:punct:]]//g“ | tr ‚[:space:]‘ ‚[\n*]‘ | sort | uniq -c | sort -bnr Let’s break it down step by step: pdftotext mypdf.pdf – displays the pdf content on the command-line   sed „s/[[:cntrl:][:digit:][:punct:]]//g“ replaces all control characters (cntrl), all numbers (digits) and all punctuation characters (punct) with an empty string. See here for character classes. tr…

0
Read More

PDF Frontpage to jpg

First find all the files you want to convert and store their filenames in a file find my-pdf-folder/ -type f -name „*.pdf“ > pdffiles.txt Iterate through that files and make a jpeg from them while read -r LINE; do pdftoppm -f 1 -singlefile -jpeg „$LINE“ „$LINE“; done < pdffiles.txt Finally move all jpgs to a separate location if necessary find my-pdf-folder/ -type f -name „*.jpg“ -exec mv {} jpgs/ \;  

0
Read More

.htaccess redirections

Simply redirecting a domain, ending with source to target/index.html RewriteRule ^source/?$ http://www.test.de/target/index.html [L] Redirecting can also be done with the Redirect Command Redirect 301 /source /target/some-folder Redirecting a complete folder structure can be done like this: RedirectMatch 301 ^/source/(.*)$ http://mydomain.de/target/$1 Redirect a request for a specific file to a folder (http://www.test/upload/file.pdf -> http://www.test.de/downloads/) The flag R stands for redirect, L stands for Last (the rule will be executed immediately, without chaining another rule) RewriteEngine On RewriteRule ^/?file\.pdf$ http://www.test.de/downloads/ [R, L]…

0
Read More

perform action on multiple files found with find command

In reality you have quite often perform a certain command on several files. First i detect all files I’m looking for and store them in a filelist. find . -name „myFilename“ > filelist.txt Second i run through this file, line by line and perform my command on all filename I’ve received one step before. while read -r LINE; do echo „$LINE“; done < filelist.txt You need to replace in several files. You can do it with sed. Be aware about…

0
Read More

how to detect space usage in linux

Getting the size of all files and folders inside the current directory can be done by typing:  ls | xargs du -s -BM Get filesize in descending order from all files in a recursive folder structure find . -type f -exec du -a -h –max-depth=100 {} + | sort -hr Another quite handy tool is ncdu. It provides you the disc usage in a graphical way on the shell. Install it like this: sudo apt-get install ncdu List folders bigger…

0
Read More