Posts

Showing posts from 2010

Resetting Printer Counter

Greedy Printer making companies such as Epson makes printers with counters. This counter will make your printer unusable after hundreds of pages. Today I've dealt such a printer. R290. Thankfully good persons made a software or hacked a software that resets your printer counter. So here is the link http://fix-your-printer.blogspot.com/2010/02/epson-stylus-photo-r290-reset.html There are so many printers with counters nowadays. So if you having some unguessable problems with your printer then search for printer reset software for your printer. And check counter if it filled with 100% just reset and your good to print. Have a nice day. And btw Merry Christmas for you all.

How to check linux ram usage

It is better use free -m instead of top. Here is why http://www.linuxatemyram.com/

Our server is getting attacked by DDOS

Recently our gamez.mn server is getting attacked by ddos. In the first I didn't know what to do. So googled and found this page http://www.topwebhosts.org/tools/apf-bfd-ddos-rootkit.php in short it will install APF - Firewall BFD - Brute Force Detection DDOS Deflate - DDoS Deflate for more detailed info  http://www.mydigitallife.info/2007/12/13/prevent-and-stop-dos-or-ddos-attacks-on-web-server-ddos-deflate/ Rootkit - Rootkit Hunter BFD and DDOS Deflate works great with APF so better install it over Iptables and then install others. And after that I started banning IPs like 67 with 67 connection like that. As you can see 67 is not a IP. So it seems attacker hid ip or is it using ipv6?  Then I've disabled ipv6 using this link. http://www.g-loaded.eu/2008/05/12/how-to-disable-ipv6-in-fedora-and-centos/   It seems quite right now. Dunno what will happen next. And Addition here is Apache Optimization tutorial http://kb.liquidweb.com/apache-optimization/ us...

I case some1 bored

Mishka r u stupid ? Noooooooooo http://www.youtube.com/watch?v=gRw-lfXy_tQ&feature=channel Rap dog http://www.youtube.com/watch?v=AWUkgwo-zJE&feature=related Even Better Mishka talking dog list http://www.youtube.com/watch?v=h4k6KNk_ywE&list=PLB596D05A243F93B3

My preffered Yum Repo

UtterRamblings is bestest out there. Maybe it just my opinion maybe everyone's. I'm updating from this repo about 2 years. Here is the link http://www.jasonlitka.com/, and here is the tutorial http://www.jasonlitka.com/yum-repository/ good luck.

My virtual host configration

This is my Virtual host configuration. #GAMEZ.MN <VirtualHost *:80>     ServerAdmin me_sor@yahoo.com     DocumentRoot /home/web/gamez.mn     ServerName gamez.mn     ServerAlias www.gamez.mn     ErrorLog /home/web/gamez.mn-error_log     CustomLog /home/web/gamez.mn-access_log common <Directory "/home/web/gamez.mn">     Options FollowSymLinks     AllowOverride All     Order allow,deny     Allow from all </Directory> </VirtualHost> It may have wrong configurations. If you think it may have some feel free to comment. I'd like to make this as web.conf and place it in /etc/httpd/conf.d/ folder

Excluding unwanted dependencies from yum update

If you like to use YUM (Yellow Dog Updater Modified) you may know unwanted bit dependencies always comes with updates and messes up things. To prevent unwanted i386, i586, i686 dependencies you just have to add exclude=*.i386 *.i586 *.i686 this line to /etc/yum.conf so it will never install or update this dependencies. As this configuration above it will only install and update 64 bit dependencies.

Preventing Root access VSFTPD

I like vsftpd (Very Secure File Transfer Protocol Daemon) than proftp. But you have to prevent exploring root folders on it. To do it just add chroot_local_user=YES this line at the end of the /etc/vsftpd/vsftpd.conf file. Sometimes this action described ass Jail root, and chroot

MySQL command source

Found a New way to import dumped sql file. It called source. Run source from mysql console window. the syntax is source folder/filename.sql  This command executes sql file as a script. Will create db insert update etc.

Set up RAID on Dell Poweredge 2850

Today I had a hard day. Our server HDD crashed (I think it had a bad sector or something? Friend of mine checked our server and said it's hard disk broken) and we had to change HDD. We got 4 SCSI HDD (72gb) for a cheap price. And decided to make a RAID. But it is way harder than regular PC RAID. I've followed THIS tutorial and settled up very good raid configuration. But real problem was just started. After setting up raid and installing nice clean centos 5.5 I decided to put a old HDD into server and copy files from there to new HDD. But server won't recognize my old HDD cause of RAID configuration. So I had to add old HDD as a RAID. And BOOM all Data is gone. It was very stupid step :( . I didn't find a way to add (mount or something) a HDD to RAID configured server. If you have solution for this pls share with me. Also I wanna restore my old HDD data. Is there a way? And again never ever try to add HDD to a RAID as a RAID

Linux Add User, Set Password, Remove User, change user folder

On linux it is very easy to crate user. adduser usernamehere passwd usernamehere userdel -r usernamehere that's all. And for changing user's folder go to /etc/passwd document and find your user and change their folder. I prefer WinSCP for SSH connection and file edition. It is very easy to use and works on all windows versions. I've tested it on XP 32bit, vista 64bit, win7 64bit. And for command line (also known as Terminal) I prefer Putty. I think everyone do.

Using Tar

And here is how to use tar tutorial link http://www.cs.duke.edu/~ola/courses/programming/tar.html in short 1. Create tar cps100 is target folder (to be compressed), foo.tgz is target file (to be created) tar cvzf foo.tgz cps100 2. Extract tar xvzf foo.tgz

Backing up all mysql DB and restoring

Every time when I wanna Backup and Restore DB I have to google again and again. So here is very good tutorial for doing this saving time http://www.webcheatsheet.com/SQL/mysql_backup_restore.php In short: 1. backup all database compressed mysqldump -u root -p --all-databases | gzip -9 > alldb_backup.sql.gz 2. restore all database + users gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]

phpmyadmin my preferred Auth Type

I love phpmyadmin. This powerful script can do on mysql database anything you want via simple web front end. In its default configuraion auth type is set to "cookie". But I prefer "http". Dunno but I like http auth.

Disable Selinux Temprory

There is many folder not found errors will come up if Selinux enabled. And if will make vsftpd stop working. For VSFTPD won't work with an issue like "oops Chroot" or cant upload anything. All you have to do is setsebool -P ftp_home_dir 1 and that is it. Many sysadmins recommends that dont Disable Selinux. But if you have to disable it run this command echo 0 > /selinux/enforce This will disable Selinux temporary until next reboot. If you wanna disable it forever open this file /etc/selinux/config and change to SELINUX=disabled. And then you have to reboot your pc

Rsync is my pal

We have been through many servers. Every time when we decides to change server I had to move them 1 by 1 , file by file, downloading and uploading. And one day I met Rsync. It was really great Rsync can synchronize (Yes I mean it. It just don't copy paste it can sync. It can check newly created edited files and syncs them with new server) files server to server via ssh. Syntax can be found here . And if you are CentOS user like me just yum install rsync.

Installing OS offline

About 2 to 3 years before we had a big server issue. I can't reach Server PC in USA from Mongolia :P. And our server support is unavailable at the time. But I have to install OS on our new server PC. Looked for solution and got Turtle. Not a regular Turtle Atomic Rocket Turtle. With turtle I had successfully installed new OS on my server. So here is the LINK don't forget. And I have very BIG Thank You to Atomic Rocket Turtle. And if you are in condition like me. Just a follow steps THERE

Reflection Script

Have you ever wondered how to make your web pictures look cool? Like reflecting them? And make reflections automatically for all pictures? That can be achieved using script from here . This script is so great all you have to do is add a little script to web page and class to image. And Viola your images will have cool reflect. Btw script is light speed and light weight so don't worry about loading time.

Tab script

You know that every website now has a TAB. Tab can include many information in one page. That is very good idea to place things in one place. So here is the coolest Tab Script . You'll love it. You can change style easily with CSS and it wont conflict with other java scripts. Also it can used more than once in one page. So if you are in pursue of great tab script your journey ends here. I promise

Replacing Blank Lines

Sometimes files got blank lines after line. It may caused from wrong type of transferring. Because of that some scripts won't work. I really doesn't know why. So I had to remove all Blank Lines from file. Of course I've searched through Google. It was already there. But time is money I really don't wont to search over and over again. So I'll post here solution. Open the file Click CTRL + F Select "Current document" in "Find in" (You can also select the folder if you have multiple files) Search in "Source code" Tick "Use regular expression" Type   [\r\n]{2,}    (without quotes) in "Find" Type " \n " (without quotes) in "Replace" Press "Replace All" This will work on Dreamweaver my long time friend. I've forgotten the source. If I find the source someday I'll definitely post here.

Selecting unique data from table

I've been searching for solution like this 2 - 3 days. I've tried array_unique(), mysql_fetch_assoc() none of them worked. It seems this functions only works with single array. But I've found a solution. Was to easy. All I had to do is change the way it selects from database using SELECT DISTINCT. You can see examples from w3 schools by clicking here. So now I can select unique data from table. Today's Lesson is taught. If something wont work try to go ANOTHER WAY. 

This blog will serve me as a memory

I've been through many coding. But after sometimes I can't remember a thing. And have to do that coding solution again and again. The funny thing is after seeing codes that I wrote I wonder who the hell is wrote that code. So I'll post my coding and solution, tricks here. This way I can remember previous coding exp. Also this blog may help some1 that looking for solutions like me. And remember guest if you have solutions and opinions, tips and tricks I'd always love to see your comment. Oh btw sry about my poor English. I'm still learning English. So be soft with my language. And also welcome