Modern Perl 2011-2012 Drafted
For all you fellow Perl lovers, Chromatic has posted an update to the old Modern Perl book. Get the 2011-2012 version there.
I haven’t read the new version yet, but have dropped it onto my tablet for those times when stuck waiting someplace. It should be considered alpha, so expect typos at this point. Read it for the ideas, not to copy/paste code.
Perl Dancer WebApp Framework
If you would like to use a really solid, web-app creation, perl module, I can completely recommend Perl Dancer. Wrote a little server a few months ago and it has been running non-stop without issues all this time. It makes the simple things trivial and … well, I’ve only done simple things so far. ;) That entire app (including the DBIx backend) is only 350 lines of code. Modern Perl rocks.
Finding Large Files On a Linux/UNIX
If you are like me, you are always running low on disk storage. After all, a hard drive that isn’t nearly full isn’t living up to the full potential. About every month, I need the find the largest files and clean them up – taking me back to 75% full on the “temporary storage” HDD.
Here’s a little script to make finding the largest files on your system easy. I call it hogs.sh.
$ find /home -type f -size +2G -exec ls -lh {} \; | cut -d" " -f5,8 | sort -t" " | tee ~/hogs.txt
May I suggest:
- Drop these commands into a bash/sh file
- Call this from the root crontab weekly, perhaps 3am Mondays
- Redirect the output into a file for later viewing as needed
- Overwrite the file with every run
The script isn’t perfect. The sorting fails but does group files nicely. It also takes awhile to complete, so running it at 3am is nice. Tweak the directory and files-larger-than parameters for your location.
Git DVCS Server Setup and Use in a Team
It seems that all the software developers are using git DVCS these days. I haven’t done serious software development in many years, so I’ve been using RCS all this time for my system admin scripting needs. With my new development work, I need to upgrade my toolset to a DVCS – Distributed Version Control System. There are many reasons to do this even if you don’t want to publish all your code on the internet. Below I’ll show how to setup an internal git server that can be shared inside a company or just between friends on the internet.
I’ll assume:
- Your git server will be on a Linux/Unix system someplace where
- all the developers will have ssh connection access.
- You have git installed on the server and the clients already.
Those server connections may allow full shell access or be limited to support just git. Regardless, setting up ssh-keys – Ssh Config Setup – is a good idea between the client(s) and the server computers.
Keep reading to learn about Git setup.
Perlbrew for Self-Contained Perl Installations 1
For years scripting languages like perl and add-ons like perl modules were supposed to be installed as part of the OS. This worked when the server administrator was the primary programmer on the system who could control all that stuff. In these days of role-based administration, the users and the administrators are hardly ever the same person. Administrators have different needs for systems than users or programmers and often those needs conflict.
How do we solve this problem for Perl scripts? Perlbrew.
Securing ssh Connections and Blocking Failures
If you have an ssh server running on your network that is accessible to the outside world, on the internet, chances are your systems are being attacked. If you aren’t aware of this, just take a look at your ssh logs in /var/log/auth.
$ egrep -i Failed /var/log/auth.log*
We can do better from a security standpoint. Regardless, ssh definitely still rocks and should be used daily, constantly. Before I moved ssh to a higher, non-standard, port and install Fail2Ban, I was seeing over 1,000 ssh attempts daily in the log files. What’s the saying … ignorance is bliss? Not when it comes to systems security.
This article is for Linux/UNIX users, but the ideas should apply to any OS running an ssh daemon.
Ssh Setup For Higher Security
The order below based on how easy it is to accomplish or setup. None of these configuration changes are hard. All of them can be accomplished in under 5 minutes if you know what you’re doing or 15 minutes if you need to read up a little.
- Listen on a non-standard port
- Use ssh-key-based connections
- No remote root logins with a password
- Allow only key-based logins from non-LAN IPs (basically any remote ssh connection cannot use a password)
- Lock account after X failed attempts – Fail2Ban
- Automatically block IPs with login failures – Fail2Ban
- Monitor hack attempts – Fail2Ban
Tips for Digital Photo Organization, Storage and Archival
By some standards, my 10,000+ digital photo collection is either very large or trivial. I suspect that professional photographers probably have hundreds of thousands of photos. Many of those will have different post-processing.
Organizing, backing up and archiving digital photos and images doesn’t have to be complicated to do well.
Organization
As you take the photos, place them into your organization. If you delay more than a week after returning from that once-in-a-lifetime vacation to Africa, then you probably will never perform any useful organization. Below are 8 steps to help you organize your photos efficiently.
Linux Related Presentation Ideas Needed 1
Last night I did a little presentation on Using VirtualBox on a Desktop. I’d give myself a D+ for a grade on the presentation. Fortunately, it was a small and highly interactive crowd. I tried to cover too much stuff. Also, I showed how to do this on a Windows host OS with a Linux client OS to a Linux-specific crowd. Initially, I’d planned to show an install on a Linux host OS too. The physical machine had a really slow disk controller, so I wasn’t able to create a virtual disk to install the OS into. I tried it a few weeks ago on the test machine and it took 45 minutes to create a 10GB .VDI file. On my home machines, doing this is just a few minutes.
The good thing was that I covered some of the key performance choices in virtualization – multiple times. The good news is that the newer VirtualBox releases choose most of these settings automatically. I should probably create a blog entry for each of the different client OSes that covers performance choices. Anyway …
Beware: Open Source Projects and Oracle 4
Oracle is effectively killing some of the most important, fantastic, open source and FLOSS tools that we’ve come to depend upon. This is really sad for the FOSS world. It will not be long before these currently open tools disappear because Oracle can’t directly make any money from supporting them. Let me explain.
Oracle is the New Evil Empire
Oracle has never been very friendly to FOSS or FLOSS, but since buying Sun Microsystems, they have effectively killed some of the most important projects.
The Almost Dead List – Some Already DEAD
- OpenSolaris
- ZFS
- MySQL
- InnoDB
- Java
- OpenJDK
- NetBeans
- VirtualBox
- Oracle VM
- GlassFish
- OpenOffice
Here’s a list of FOSS from Oracle that will probably be only useful for historical purposes soon. Most of the leaders for these projects that Oracle got with the Sun purchase have left Oracle after trying to fit into the new corporate culture. Full disclosure: I’ve owned Oracle AND Sun Microsystems stock over the years. Since the Sun purchase, I sold ORCL and haven’t owned any shares on over a year.
If you are currently using any of those tools, you need to make strategic plans for alternates. Oracle *will be killing them off. Some will be saved by creating new FLOSS projected based on the last open license version.
Alternatives for Some
- ZFS – BTRFS
- MySQL – Postgres
- Java – Ruby or C++ (or any number of lesser known languages like D for F#)
- VirtualBox – KVM or VMware Player
- OpenOffice – LibreOffice
Or you can just plan to purchase the right to use the tools at Enterprise Software Costs. Not cheap.
I’m not actively using most of the software listed above except VirtualBox, OpenOffice and MySQL. For those, I have alternatives, but like almost everyone else, change isn’t easy until it is forced on us.
I’m not anti-corporations, but Oracle has not been a good steward and I have no reason to believe they will change. Just look at the handling of the OpenSolaris shutdown. I was a member of a local OpenSolaris UG. The leader was a well known and respected former Sun Systems Engineer, currently working for Oracle. I miss the UG. Oracle has proven they cannot be completely trusted. They are willing to change the rules.
Without the GPL, BSD and similar FOSS licenses, we’d be completely screwed. Now is a good time to donate to the EFF or FSF. A $20 donation will go a long way.
Web-Ready PowerPoint Replacement
Came across an article on Linux.com about replacing Power Point with a different solution. S5 is a tool that I use to give presentations. It means the presentation is ready to be put on the web immediately, it is already a web page. It works and you can customize the way it looks, but the default is fine too.
S5 stands for Simple Standards-Based Slide Show System – it is an HTML file with javascript and CSS support files to control navigation and slide presentation, so it works the same on every platform. Just a browser is needed to view the presentation – pretty much any reasonable browser will work. Get the S5 files. and get started.
MKV Containers - Why Use Them + Scripts 5
So the HD-Nation video-cast (available online or on your TiVo) did a few episodes about what you can do with MKV containers for your media.
- Episode 68-MKV Basics
- Episode 69-User Feedback – MKV part is about 28 minutes in.
Below are a few other links about MKV Containers and a few shell scripts to get the MKVs to playback correctly.