Archive for the ‘linux’ Category

I want a super home entertainment system– DVR, multi room audio and music, media center, the works.

Thursday, July 15th, 2010

So here is my latest hunger– moving out into an apartment with my buddies that is an incredible media hub.

Like…

  • Being able to record TV and send it to any computer at any time…
  • Or send LIVE TV to any room’s computer at any time!
    • If I’m lucky, that means that we can watch multiple channels from multiple boxes with only one cable box, or high-quality decipherable stream…
  • Being able to watch internet videos on the main TV…
  • Being able to watch whatever videos were loaded onto it!
  • Being able to send DVDs across rooms!
  • Being able to remotely tell the program to download torrents and other media, keeping users separate, but all within the upload limit, and allowing remote access to the files! 8)
  • Receive Audio from the main radio station in the house..
  • And broadcast to the household radio station from any computer!
  • Even to play a role as a game server!

It’d be complex, but damn.  I think this’d be awesome.  I think I’d need a great ethernet card, some nice RAID management.. etc..

What a headache, but fun!

Another Mentor Friend’s discoveries re: Pylons Caching, Apache Maintenace Pages & Status 307, mod_fastcgi and Gzip, and more.

Saturday, March 20th, 2010

My friend Eevee who runs a Pokedex (A list of Pokemon, moves, abilities, TMs, HMs, etc) is a competent web developer.  I used to have a mIRC scripter (Merc) who mentored me on mIRC scripting and intelligent coding.  I think I then had a friend (Erica) who was a compatriot when it came to developing HTML and CSS websites.  I had a mentor (Nathan) who helped me with PHP, and another mentor (Mike) who helped me with an introduction to Linux and Python.  However, when it comes to higher levels of thought for web servers, I’ve been trusting Eevee for his opinion.

I was recently blown away by yet another one of his informative posts.  This one covered a range of topics. Pylons caching of page template bodies/body; Apache maintenance page / pages; http status 307 versus refreshing your browser; and mod_fastcgi problems with gzip. The amount of things he faces when he’s just doing coding as his hobby impresses me. I’ve been working on my own project, but I can only hope I learn as much as he has when I need it!

I suggest you take a look– he’s written many other informative posts at his (Eevee’s) journal.

Incredible Linux server Vulnerability – Fork Bombs and protecting yourself against them!

Tuesday, November 24th, 2009

I only recently learned about Fork bombs. The idea is that a user who can successfully log onto your server will run a simple program that will tell the server to run more simple programs– these programs may do nothing malicious by themselves, but when they keep creating more and more kids, your server’s resources will dwindle until the server has nothing remaining to operate with.

This VERY IMPORTANT POST about limiting user’s process/RAM Limits will help you guarantee that users will find it hard, if not impossible, to abuse the system with a fork bomb.

I suggest you read the above posts and immediately secure any Linux servers you are running!

How to Listen on Multiple (More) IP Addresses on Linux

Friday, October 9th, 2009

One of the best articles that discussed how to bind or listen on multiple IP addresses is this article:

Bind Multiple IP Addresses to a Single Network Interface Card (NIC)

Amazing!  Useful!

Burning Images (ISO) from Floppy Disks in Debian Linux

Saturday, September 19th, 2009

Recently, I just got some Legacy software. Woo!
On floppy disk. What is this, 1990?

So, my beta/Old PC was the only one that had a disk drive. And that computer had Debian linux.

So, let’s get these to my pc!

Step 1:
Make sure the floppy drive works.

mount -t vfat /dev/fd0 /media/floppy0

If that says something like

mount: /dev/fd0: can't read superblock

, then open up your computer and make sure that the floppy drive works. This happened to me, and apparently I had forgotten to.. well.. hook up the drive.... remember to do that.
SU up to root in case you can’t mount.
Tip: you have to specify a filesystem format when you mount the drive. -t is the switch that does so.

Step 2:
If the above step works, you’ve mounted the drive. You’re going to need the following two commands:

  • md5sum – but only if you have more than one disk involved with your ISO burning work.
  • mkisofs

md5sum is to help you verify that, when you are mounting and unmounting disks, that your unmount attempts are working.

how to install MD5sum on debian linux

apt-get install isomd5sum

How to burn ISOs in Debian Linux– required step: install mkisofs

apt-get install mkisofs

OK. So now that you have the required software,

Step 3:

mkisofs -r -o /path/to/desired/ISO/file/newFileName-0.iso /media/floppy0

The above step creates the ISO file.
Then, umount your disk. Make sure to leave the /media/floppy0 folder if you were just in there! You can’t unmount a folder you’re in.

umount /media/floppy0

Repeat step 1 as many times as necessary.

Step 4: (optional)
Use md5sum to check the MD5 of a file. Do this with the ISO files you want to compare.

~# md5sum /path/to/desired/ISO/file/newFileName-*
a583c9cc94c11d0e35b4967b79f979a0  /path/to/desired/ISO/file/newFileName-0.iso
7f15179dbc68c18b2f91ecd9365b7c70  /path/to/desired/ISO/file/newFileName-1.iso

If you have more than one matching MD5 answer (first column), the files are likely to be the same.

Step 5:
Make sure to unmount the last disk, and then transfer your files to your destination computer.

Stay cool, viewers!

The URL I used to help myself with this:
http://vertito.blogspot.com/2007/08/iso-creation-and-cddvd-burning-from.html

Illegal Mix of Collations using CONCAT

Friday, September 4th, 2009

While using MySQL5, I came across this error:

Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation ‘concat’

When I took a look at the query statement, I realized that I was doing a CONCAT with an IF statement being the first part.

EG:
CONCAT(If(1=1,'true','false),' : ',columnb) as variable

This post by Vahid Ghafarpour on Illegal Mix of Collations helped me out when I tried to change the character sets of the database, but I realized that it might be a server default causing this.
Since I didn’t want to change the statement, I changed the query. (I suppose it’s bad practice. :( )

Based on this post at Experts Exchange on the Illegal Mix of Collations, I added COLLATE latin1_swedish_ci after the string. Now, THIS didn’t work:

CONCAT(If(1=1,'true','false),' : ',columnb) as variable COLLATE latin1_swedish_ci
You’ll see why it didn’t work in a second.
CONCAT(If(1=1,'true','false),' : ',columnb) COLLATE latin1_swedish_ci as variable
Didn’t work as well.

What worked is below:
CONCAT(If(1=1,'true','false) COLLATE latin1_swedish_ci ,' : ',columnb) as variable
This is because it’s the IF statement that left its type ambiguous.

Stay cool, coders!

Error While Loading shared libraries , cannot open shared object file: no such file or directory (Easy solution?)

Tuesday, August 25th, 2009

Have you tried ldconfig yet?

I was working on a website that needed to use libraries from some lib directory on Linux. (it’s not like I understand WHERE To put files or install them yet, eh?)

But, after compiling and installing a program, I got the title of this post as an error message (with my specific library mentioned.)

How did I solve it? ldconfig

If it doesn’t work after that, good luck! MY problem was solved. :P

How to Figure Out the Last Month (Previous Month) in MySQL

Thursday, August 20th, 2009

In the Traceback URL, I indicate the article I used to figure this out:

DATE_FORMAT(DATE_SUB(DATE_FORMAT(CURRENT_TIMESTAMP,'%Y%m01'), INTERVAL 1 MONTH),'%Y%m' )

Indicates one month prior to the current (in the form of YYYYMM).

Take a look at this mention in the MySQL Documentation for Date_Sub.

Configuring Syslog (Syslogd) on Debian to Automatically Accept Remote Logging on reboot or on restart

Friday, August 14th, 2009

I wanted a Debian linux server to become a remote logger for another Linux host.  I had edited this other remote host’s /etc/syslog.conf to have a copy of all its logs sent to a remote server.

However, this remote server was not accepting information as I had requested.  Sure, I could restart the service with the desired parameters, but it wouldn’t stick around after a reboot!

That is, until I found this post on how to edit the parameters of the file in Debian Linux.

Simple as pi!  Edit the /etc/default/syslogd file and include the -r parameter!  Now I remote-log by default.  Works great!

I also edited my /etc/hosts file to include the server I am receiving logs from.  That way the syslog file is less messy!

Installing CPAN Perl Modules without HTTP, FTP, DNS, or CPAN Access

Thursday, August 13th, 2009

This was pretty easy.

Step 1. Download the module you want from CPAN.org.  In this example, it’s the File::Tail module.  (The download link is the ‘download tar.gz’ link.  Not the source.)

Step 2.  Upload it to the destination server directly, OR use the SCP command to transfer it from another web-server to your destination server.

My preferred method was using wget at the middle server so I didn’t have to manually upload it to the middle server myself!

Step 3.  On the destination server, which now has the file, run tar -xzf (filename) to extract the file from the tar and GZip.  It will likely be in a folder that matches the name of the original tar.gz file.

Step 4. Go to the newly created folder (cd) and look at the readme file.  (Try using the VIM editor by typing vim (filename) .  When done reading, type :q to exit the file.  ( :q! to exit without saving any accidental changes.)  The readme file should have listed a few perl commands you should execute– usually ‘perl makefile.PL’, then ‘make’, then ‘make test’, then ‘make install’.

Step 5: After executing the commands requested by the readme file, you should be done!  If you need to resolve any dependencies to install this package, go back to step #1 and try again with the new package.

Best of luck!