Freetds is a set of libraries for Unix and Linux that allows your programs to natively talk to Microsoft SQL Server. A clinet requested to have it compiled with PHP so I did it for him and wrote a guide to be used in future. I am writing the installation of freetds and then php compilation with mssql support. Continue reading »
DNS stands for “Domain Name System” and helps resolving domain names to IP numbers as it is much easier for people to remember logical names rather then a 12 digit number. DNS uses 3 major components”Resolvers (client)”, “Name Servers” and “Domain Name Space”. In basic DNS communication a client (Resolver) sends a query to a Name Server, which returns with the requested information or an address for another Name Server, an error message is received if the query gives no results. Continue reading »
A database is a collection of data organized in a particular way. Databases are managed by DBMS (Database Management Systems) like MySQL, PostGreSQL, Oracle, Microsoft SQL Server, IBM DB2 etc. SQL is the language used to query all databases. It’s simple to learn and appears to do very little but is the heart of a successful database application. Continue reading »
You may have seen core.xxxx (where xxxx can be any number) files on your server and noticed that these files consume alot of space and sometimes a disk partition reaches its limit because its full of core dump files. So whats this file for? Basically when any process crashes or get terminated abnormally then kernel dumps the data residing in the memory at that time in to a core file so that it can be debugged later to find the cause of abnormal termination. The detailed and well explained description can be found at Core dumps. If you want to clear up these core files consuming your server’s disk space then you can run the following command:
find / -name “core.[0-90-9]*” -type f ! \( -name virtfs -type d \) -print | xargs rm -vf
The above command will search the entire server for any file named core.xx and will delete it. Before running this command, I would recommend to first check that what will be deleted by running:
find / -name “core.[0-90-9]*” -type f ! \( -name virtfs -type d \) -print
It will show all the core files present on the server. You should go through the list and if you see that all are core dump files then use the first command to delete all the core dump files to free up the space.
Use the “file” command to see what application caused them to be generated. For example:
$ file core.1234
They were most likely the result of a PHP process crashing for some reason that would require further investigation, such as with gdb:
$ gdb /usr/bin/php core.1234
- Reboot the system and wait for the GRUB screen to appear.
- Highlight the kernel version you’re currently using (usually the newest version) from the GRUB list.
- Press “e” to be taken to the boot commands edit screen, highlight the line which starts with kernel and press “e” again.
- Add “single” to the end of the line, so it will look like this:
kernel /vmlinuz-kernel-version ro root=LABEL=/ rhgb quiet single
- Press “Enter” to save the changes
- Press “b” to boot in single user mode.
The system will begin loading and, at some point, you will be presented with a root bash prompt.
In the new prompt type “passwd” and choose a new password for root.When done, type reboot to restart the system. After reboot, GRUB will be back to normal so no further modifications are required.
NOTE: If you are asked for the root password before dropping you in a bash prompt in single user mode, you should follow the instructions above and append “single init=/bin/bash” to the kernel line, not just “single“.
I wrote this bash script to control DDOS attack. It doesn’t block the Ips automatically but will show you a list of Ips that have more connections than defined in Max variable. It will display a menu and its easy to use. The script will also log the activities in a log file so you can latter check that which Ips were blocked by it. Continue reading »
Environmental variables are usually used to store the paths so that you don’t have to remember the complete path. Wouldn’t it be easy to just write %windir% in Run or command prompt to open the folder where Windows is installed? Yes, thats the use of environmental variables. Same applies to Linux platform too, just the difference is that in Linux you need to use $ sign before the variable name. Continue reading »
Here is a simple bash script that I wrote to get a notification email whenever any of the server partition grows over the defined size. The size can be defined for MAXSIZE variable. You can then setup a cron to run this script after every few hours. You will not be bombarded with the notification emails as this script will send the notification email only when a partition is over the MAXSIZE. Continue reading »