Published on February 27, 2011 by Amir Sedighi
I was looking for a tutorial to fetch data from MySQL on Mac OS X or Linux flavors. This helped me. I just modified it a bit. After saving the following code as myclient.c: /* See url for more info: http://www.cyberciti.biz/tips/linux-unix-connect-mysql-c-api-program.html */ #include #include #define Q1 “insert into test (a , b) values (? , [...]
Posted in Cocoa/Objective-C, Linux
Published on September 25, 2010 by Amir Sedighi
“Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices.” Wikipedia. That is just an abstract definition. I use SSH to do much more. Here are just some simple commands that I used to run for such a different reasons: Whenever I need [...]
Posted in Linux
Published on September 7, 2010 by Amir Sedighi
The best way for accessing the folders outside Tomcat webapps folder is mapping folders using mount-points. Assume the application folder located in below path: (MyApplication) /home/amir/java/tomcat/webapps/MyApplication/ I need to upload files into another machine so I just created a folder “hugeSizeFolder” into the “MyApplication” folder. Then I mapped it to a remote shared folder. Assume [...]
Posted in Java, Linux
Published on August 28, 2010 by Amir Sedighi
Introduction Here you will find how to monitor an application which is hosted in Apache Tomcat. There are many reasons for monitoring an application in run time. In our case the client was looking for some measurable factors that shows slap of business ratios on demand. Moreover, the technical department was looking for fine-grain informations [...]
Posted in Java, Linux, Software Engineering
Published on August 25, 2010 by Amir Sedighi
Introduction. A business company was looking for a proper method to monitor it’s business applications. They were almost implemented by Java. Firstly I was going to implement another application for this purpose. Fortunately a friend of mine shows the way. We planned to use JMX. Here is a tutorial that clearly shows you how to [...]
Posted in Java, Linux, Software Engineering
Published on July 5, 2010 by Saeid Zebardast
To see some part of a text file, use the following methods: 1- To get top 20 lines of a file header, use: $ head -n20 FILE 2- To get 30 line of bottom of a file, use: $ tail -n30 FILE 3- If you want to print some lines that they are not in [...]
Tags: Command Line, Linux
Posted in Linux
Published on June 22, 2010 by Amir Sedighi
Find is the must powerful tool for seeking files or directories in Linux. Here I just used find in some samples. People almost learn better using samples. A famous man who I don’t remember his name told that “the example is not a major tool for learning people. It is the only one.” So have [...]
Posted in Linux
Published on June 21, 2010 by Amir Sedighi
Introduction Having an acknowledge of Linux file system let to work better. Here is an introduction to Linux Filesystem Hierarchy Standard (FHS) and some samples of finding files commands. Linux Filesystem Hierarchy Standard (FHS) Linux or other UNIX®-like systems use a specific standard for categorizing and management Filesystem Hierarchy. This standard has definced as a [...]
Posted in Linux
Published on June 19, 2010 by Amir Sedighi
First Scenario: Using Java as programming Language A friend of mine and I decided to parse a huge size text file that consists some reports of legacy devices. After few times trying we got that, opening and parsing huge text files in Java is a pertty time and resource consuming. We started with a 35MB [...]
Posted in Java, Linux
Published on June 19, 2010 by Seroj Alaverdian
In order to change MySql root Password in linux, you need to follow these simple steps: 1.Login as root to linux 2.Stop MySql server /etc/init.d/mysql stop 3.Start MySql safe mode with –skip-grant-tables so there will be no prompt for password /usr/bin/mysqld_safe –skip-grant-tables 4.Now login into MySql mysql -u root 5.Update password and flush privileges UPDATE [...]
Posted in Linux, MySQL
No Comments