Posts

How to remove first n lines from a text file?

On Linux is quite easy. tail -n +100 largefile.txt > largefile.txt.tmp mv largefile.txt.tmp largefile.txt The above sample will remove the first 100 lines.

What an architect should first think about

I'm currently reading the book Beautiful Architecture . In one of the chapters the author outlines what an architect should take into consideration when thinking of a new system. There are 9 things. Functionality What functionality does the product offer to its users? Changeability What changes may be needed in the software in the future, and what changes are unlikely and need not be especially easy to make in the future? Performance What will the performance of the product be? Capacity How many users will use the system simultaneously? How much data will the system need to store for its users? Ecosystem What interactions will the system have with other systems in the ecosystem in which it will be deployed? Modularity How is the task of writing the software organized into work assignments (modules), particularly modules that can be developed independently and that suit each other's needs precisely and easily? Buildability How can the software b...

Cool stuff about geo search and MySQL

If found some nice articles about performing geo queries on MySQL: http://www.rooftopsolutions.nl/blog/tag/rtree

Find the large files on Linux

Here is what I use to find the large files: find /usr -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Java & Web Security Training

This week I attended a 3 days training on Java and web security with Ernő Jeges from SEARCH-LAB . It was nice to refresh my memory on the theoretical part, and I also got the chance to study and test many vulnerabilities. Below some notes I took: intro: - running away of competition not of the hackers (bear story) - SPIT = spam over voice over ip - $1000 - sharing bootnets for spam delivery or 1 mil email addresses - www.eegs.com - Common Criteria - security standard java: - applets can only talk with the origin server - jca/jce - core of java security - jca: for data integrity - jce: for confidentiality/encryption - jaas: authentication & authorization - use RSA for encrypting a secret key to be used for symmetric encryption because RSA is CPU expensive - blind signature - checkout SecureRandom vulnerabilities: - google: mysql injection cheat sheet - sql injection - xss - upload a php/jsp page instead of a image - hasing passwords is not enough, always use hash(password, salt) or...

Reverse SSH Tunneling

With reverse SSH tunneling you can ssh to your Linux machine that sits behind NAT or a firewall. There are 2 simple steps: Let's assume that Destination's IP is 192.168.1.10 (Linux box that you want to access). You want to access from Linux client with IP 138.47.28.28 . Destination ( 192.168.1.10 ) 138.47.28.28 ) 1. SSH from the destination to the source (with public IP) using command below: ssh -R 2022:localhost:22 sourceuser@138.47.28.28 2. Now you can SSH from source to destination through SSH tunneling: ssh -p 2022 localhost

Blog Mission

A brain dump of my day to day endeavors in the world of systems programming an architecture.