Linux

Linux
SRE

The First 10 Minutes: Troubleshooting a Linux Server

A humorous and dramatic guide to troubleshooting Linux servers in production. When everything is on fire and Slack is blowing up, here’s your survival guide for the first 10 minutes of incident response. Or: How I Learned to Stop Panicking and Love the Command Line.

16 min read
Linux

Ten Essential Linux Admin Tools | Linux Magazine

System Administrators SAs need a set of tools with which to manage their often unmanageable systems and environments. These ten essential Linux administration tools provide excellent support for the weary SA. Those listed aren’t your standard list of tools deemed essential by industry bystanders. These are tools that have proven track records and have stood the test of time in the data center.

Read on for the list.

via Ten Essential Linux Admin Tools | Linux Magazine.

1 min read
Linux

Linux command to gathers up information about a Linux system

If you are developing an application for Linux desktop and would like to automatically find out more information about system, use the following commands in shell scripts to gather information about system. Recently I was involved in project where I need to collect information about running GUI, browser and other information such as disk space, running kernel etc.

Linux command to gathers up information about a Linux system.

1 min read
Linux

SSH and SCP: Howto, tips & tricks

A basic tutorial about the Linux commands ssh and scp. It features explanation about the syntax, the possibilities and the differences between the two. It also features some tips and tricks that'll come in handy when working with these programs.

read more | digg story

1 min read
Linux

ShellSQL - SQL for shell scripts

| ShellSQL - SQL for shell scripts | ShellSQL is a suite of programs designed to enable LINUX/UNIX shell scripts to connect to SQL engines and execute SQL queries and commands in a simple way enabling intergration with the rest of the script. For example, it can do things like..

#/bin/shHANDLE=`shpostgres dbname=mydb`

shsql $HANDLE "begin"

for ARG in $

do

shsql $HANDLE "insert into mytable fld1, fld2" \

"values nextvalmyseq, $ARG"

done

shsql $HANDLE "commit"

if [ $# -gt 0 ]

then

ROWS=`shsql $HANDLE "select count from mytable"`

echo "No of rows now in table is" $ROWS

fi

shsqlend $HANDLE

For details on how it hangs together have a look at the overview.

1 min read
Linux

All about Linux: Enabling and disabling services during start up in GNU/Linux

| All about Linux: Enabling and disabling services during start up in GNU/Linux | In any Linux distribution, some services are enabled to start at boot up by default. For example, on my machine, I have pcmcia, cron daemon, postfix mail transport agent ... just to name a few, which start during boot up. Usually, it is prudent to disable all services that are not needed as they are potential security risks and also they unnecessarily waste hardware resources. For example, my machine does not have any pcmcia cards so I can safely disable it. Same is the case with postfix which is also not used.

3 min read
Linux

Ubuntu Unleashed: The Top Security Tools in the Ubuntu with 1 click Installation!

Ubuntu Unleashed: The Top Security Tools in the Ubuntu Repositories you may not know about with 1 click Installation!

Here is a collection of security tools that you should look through to add to your arsenal to help keep the peace on your pc/network or unleash war on others for whatever reason.

| Most of these are command line tools which need to be invoked via the Terminal: | Applications->Accessories->Terminal

1 min read
Linux

How to Change the Timezone in Linux - wikiHow

| How to Change the Timezone in Linux - wikiHow | Most modern Linux distributions have user-friendly programs to set the timezone, often accesible through the program menus or right-clicking the clock in a desktop environment such as KDE or GNOME. Failing that it's possible to manually change the system timezone in Linux in a few short steps.

| 1. Logged in as root, check which timezone your machine is currently using by executing date. You'll see something like Mon 17 Jan 2005 12:15:08 PM PST, PST in this case is the current timezone. | 2. Change to the directory /usr/share/zoneinfo here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the "America" directory. | 3. If you wish, backup the previous timezone configuration by copying it to a different location. Such as

1 min read
Linux

How to unzip very large files

Some windows programs use a compression for larger files that is not compatible with the linux unzip command. Resulting in the following error:

need PK compat. v4.5 (can do v2.1)

There is a special program for handling these large files: p7zip

Run these commands to install and run:

$ curl -o p7zip_4.20_src.tar.bz2 http://internap.dl.sourceforge.net/sourceforge/p7zip/p7zip_4.20_src.tar.bz2

$ bunzip2 p7zip_4.20_src.tar.bz2

$ tar xvf p7zip_4.20_src.tar

$ cd p7zip_4.20_src

$ make

$ make install

$ 7za x largefilename.zip

This saved my ass... let me know how it works for you.

1 min read
macOS

launchd: Better than sliced bread - Chris Hanson

| Chris Hanson - launchd: Better than sliced bread | Simply put, launchd is what makes it easy to get tasks launched on-demand on Mac OS X 10.4 and later. It obviates lots of different archaic Unix infrastructure — init.d, cron, inetd — in favor of a single self-consistent and easy to use mechanism. Dave Zarzycki’s post Where to begin? describes the launchd design philosophy in some depth.

Processes launched at startup on Mac OS X are managed by launchd. There’s no careful balancing of init.d or SystemStarter scripts on modern releases of the operating system. Instead, launchd jobs have property list entries in the LaunchAgents and LaunchDaemons directories in the system and local domains. Some specify that launchd should keep them alive indefinitely, others simply provide conditions under which they should be launched.

2 min read
Linux

O+P Insights: Linux HW RAID Howto

| O+P Insights: Linux HW RAID Howto | Hardware RAID boxes are cool things. Plug them in and they behave like a big and fast disk. If properly configured, they'll be another 30% faster. | Issue

There is great software RAID support in Linux these days. I still prefer having RAID done by some HW component that operates independently of the OS. This reduces dependencies a great deal and takes load of the server.

2 min read
Linux

Using Rsync and SSH

| Using Rsync and SSH by Try Johnson of troy.jdmz.net | I like to backup some logging, mail, and configuration information sometimes on hosts across the network and Internet, and here is a way I have found to do it. You'll need these packages installed:

| * rsync | * openssh | * cron (or vixie-cron)

| Please note these instructions may be specific to Red Hat Linux versions 7.3, 9, and Fedora Core 3, but I hope they won't be too hard to adapt to almost any *NIX type OS. The man pages for 'ssh' and 'rsync' should be helpful to you if you need to change some things (use the "man ssh" and "man rsync" commands). | First, I'll define some variables. In my explanation, I will be synchronizing files (copying only new or changed files) one way, and I will be starting this process from the host I want to copy things to. In other words, I will be syncing files from /remote/dir/ on remotehost, as remoteuser, to /this/dir/ on thishost, as thisuser. | I want to make sure that 'rsync' over 'ssh' works at all before I begin to automate the process, so I test it first as thisuser: | $ rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/ | and type in remoteuser@remotehost's password when prompted. I do need to make sure that remoteuser has read permissions to /remote/dir/ on remotehost, and that thisuser has write permissions to /this/dir/ on thishost. Also, 'rsync' and 'ssh' should be in thisuser's path (use "which ssh" and "which rsync"), 'rsync' should be in remoteuser's path, and 'sshd' should be running on remotehost.

2 min read
Web Development

Time For A Grown-Up Server: Rails, Mongrel, Apache, Capistrano and You | codablog | Coda Hale

| Time For A Grown-Up Server: Rails, Mongrel, Apache, Capistrano and You | codablog | Coda Hale | More and more Rails developers are finding out that deploying a Rails application isn’t as simple as upload and rename; Rails apps work best when running all the time, and many Rails programmers are moving from traditional, shared hosts, like Dreamhost, to virtual private servers, like Rimuhosting, which allow them full control and responsibility of production servers.

1 min read
Web Development

How to Querying the RPM database - tuxfiles.org

| Installing software from RPM packages in Linux | How to Querying the RPM database

| As you already know, the RPM database contains a list of all installed RPM packages on your system. You can query this database to get info of the packages on your Linux system. To query a single package, you use the -q option. For example, to query a package whose name is "software": | # rpm -q software

2 min read
Web Development

Ubuntu Linux view the status of my NIC

| Ubuntu Linux view the status of my network Interfaces/card | Q. How do I view the status of my network Interface card under Ubuntu Linux ? How do I make sure connectivity exists?

A. You can verify connectivity or status of your network Interfaces/card using standard Linux command. Open your terminal and use following commands:

| Ifconfig command use to view status of network Interfaces card or use to configure a network interface itself. | Task: View network interface card

1 min read
Linux

SUPERGUIDE: The Open Source Challenge. How to replace Windows completely with Ubuntu. | APC Magazine

| SUPERGUIDE: The Open Source Challenge. How to replace Windows completely with Ubuntu. | APC Magazine | When I was first given this task I had to sit and blink a few times, if for nothing else than dramatic pause. Im a self-confessed Linux nut, as some of you may know, but even Im cautious to do away with Windows completely. Theres a reason I have a dual-boot Windows and Linux machine. Several of them, in fact.

1 min read
Programming

Linux / UNIX: Python programming tutorial for system administrators

| Linux / UNIX: Python programming tutorial for system administrators | Generally I use Perl and Shell script for automation or to make system administration easier for me. Python is an interpreted, interactive, object-oriented programming language that combines remarkable power with very clear syntax. Python runs on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm Handhelds, and Nokia mobile phones.

You can easily adopt Python to manage UNIX and Linux systems while incorporating concepts of good program design. Python is an easy-to-learn, open source scripting language that lets system administrators do their job more quickly. It can also make tasks more fun:

1 min read
Linux

Learning and Mastering the Linux VI / VIM editor

| Learning and Mastering the Linux VI / VIM editor | VIM is my preferred text editor for configuring system and writing code at a shell prompt. However many new Linux user finds it difficult to cope with vim. This tutorial provides a good introduction:

The VI editor is a screen-based editor used by many Unix users. The VI editor has powerful features to aid programmers, but many beginning users avoid using VI because the different features overwhelm them. This tutorial is written to help beginning users get accustomed to using the VI editor, but also contains sections relevant to regular users of VI as well. Examples are provided, and the best way to learn is to try these examples, and think of your own examples as well… There’s no better way than to experience things yourself.

1 min read
Security

macosxhints.com - OS X VPN client and Cisco ASA

| macosxhints.com - OS X VPN client and Cisco ASA | Summary: This hint is for Network Engineers who want their firewalls to accept VPN connections from standard OS X L2TP / IPSec clients (should also work for Windows and Linux clients). If you are not a network engineer, but are having trouble connecting to one of these devices, you can also forward this tip to your company's "firewall person," so that they can fix it.

1 min read
Linux

10 Linux Shell Tricks You Don't Already Know. Really, we swear.

| Here’s a bunch of damn useful commands you haven’t heard before. | 1. A Simple way to Send Output and Errors | 2. Parallelize Your Loops | 3. Catch Memory Leaks By Using Top via Cron | 4. Standard in directly from the command line | 5. Set a Random Initial Password, That Must be Changed | 6. Add Your Public Key to Remote Machines the Easy Way | 7. Extract an RPM without any additional software | 8. See How a File Has Changed from Factory Defaults | 9. Undo Your Network Screwups After You’ve Lost the Connection | 10. Check a Port is Open

1 min read
Linux

Linux HOWTO: NetMasks Explained

| Linux ipnatctl HOWTO: Selecting What Packets To Mangle | If youre not familiar with the /-notation used for network addresses, it works like this.

Every machine needs an individual address. To keep things simple, we assign them in clumps; each network of machines generally gets a range of addresses.

A single IP address is 32 bits long: printed in binary has 32 binary digits, each 1 or 0. Its standard to print them as 4 decimal numbers, each representing 8 bits, such as 192.168.1.1. In binary, this would be 11000000101010000000000100000001.

2 min read
macOS

How to - disk recovery with ddrescue on Mac 10.4

I had a dead, clicking hard drive. It would not mount so most repair utilities and Apple Disk Utility couldn't see the drive to repair it. Data Rescue II and DiskWarrior (even advanced recovery mode) would run for a while but eventually error out. dd_rescue (read third comment) is a linux utility that is very powerful and persistent but wouldn't compile for me in Mac OS 10.4. I finally had success with a similar linux tool ddrescue and this article.

4 min read
Linux

HOWTO Create Your Personal All-In-One USB Knoppix 5.1.0

You can take your desktop wherever you go, on USB stick, and newest working Debian 4.0 'Etch' to boot! The well-known flavor of Debian, engineered in Germany by Klaus Knopper, empowers you to step over all them troubles with freaky Windows. MS-Windows stuff is so much last century... totally uncool bloatware. USB Knoppix might be the right answer!

read more | digg story \<http://digg.com/linux_unix/HOWTO_Create_Your_Personal_All_In_One_USB_Knoppix_5_1_0_hot\>__

1 min read
Web Development

Scripts to create an IP info summary display

macosxhints.com - Scripts to create an IP info summary display

<http://www.macosxhints.com/article.php?story=20060901055801748>`__

I created the following scripts to mimic the ipconfig /all functionality found in the Windows NT operating system. In the unix world, all of the info is available, but not in one place which is where this script comes in handy. It concatenates all of the various pieces of IP configuration into one easy-to-read display. The bonus is all of the functions used are contained in a separate file, which can be sourced into your shell environment and used individually.

1 min read
Web Development

Intro to Open Source Scripting on Mac OS X

Introduction to Open Source Scripting on Mac OS X

One of the biggest advantages of Mac OS X's UNIX heritage is the huge range of open source scripting languages available. Scripting languages are often the ideal tool if you want to manipulate text, manage jobs, or link together disparate components without resorting to a compiled language like C or Objective-C. Scripting languages are a great tool for system administrators, application developers, and pretty much any user who needs to perform complex or repetitive tasks, because they were invented to solve these types of problems more quickly than can be done with general-purpose languages.

1 min read
Linux

Sysadmin toolbox

This is mainly for Linux folk but Mac Admins should be able to find equivalent tools.

"Every administrator has a set of software tools that he just can't live without. These are the utilities that you install as soon as you log into a new machine, to help make day-to-day tasks a little easier. Here are my top 10 tools."

read more | digg story \<http://digg.com/linux_unix/My_sysadmin_toolbox\>__

1 min read
Linux

Mac OS X - Hidden Files

Articles > Trash or Treasure" href="http://maczealots.com/articles/hiddenfiles/">MacZealots > Articles > Trash or Treasure

The idea of a hidden file has changed since the days of the classic Mac OS, where a file's "hidden" attribute was set in the resource fork of the file, and wasn't immediately accessible to the user. In OS X (and UNIX in general), it's much easier. All you have to do is preface the name of a file with a period ("."), and the file won't show up in the Finder, as well as Save/Open dialogs, etc. This can be a good way to hide a confidential file

1 min read
Web Development

Linux and Mac OS X, all on one PowerBook?

| Thanks Dave Taylor | In a bit of a break from business analysis, I thought it would be fun to post one of my more technical articles to re-establish my "geek cred", if you will. This article details the trials and tribulations of turning a perfectly good Apple PowerBook into a tri-boot system with Mac OS X, Yellow Dog Linux and Ubuntu Linux. Mac OS X is built of two components, Darwin, the BSD-based Unix underpinnings, and Aqua, the beautiful graphical user interface we Mac heads have all grown to love. However, there are other operating systems and other work environments that can be installed on an Apple system, based on popular open source Linux applications. If you’re looking for Intel-based versions of Linux,... In a bit of a break from business analysis, I thought it would be fun to post one of my more technical articles to re-establish my "geek cred", if you will. This article details the trials and tribulations of turning a perfectly good Apple PowerBook into a tri-boot system with Mac OS X, Yellow Dog Linux and Ubuntu Linux.

2 min read
macOS

Mac OS X Panther

| Mac OS X Panther is set to roar onto the scene later this year, and itís something you donít want to miss. No matter how you use your Mac, Panther makes better, sporting improvements from head to paws. Learn more about the future today in this Sneak Preview, and stay tuned for more news of the future. | Link | | As a super-modern operating system, Mac OS X already combines the power and stability of Unix with the simplicity and elegance of the Macintosh. Its gorgeous user interface, Aqua, brings your desktop to life with expressive icons, vibrant color and fluid motion. Cutting-edge graphics technologies offer capabilities beyond anything ever seen in a desktop operating system. At the foundation of Mac OS X lies an industrial-strength, Unix-based core operating system, called Darwin, that delivers unprecedented stability and performance. And only with Mac OS X can you run Microsoft Office, Quark XPress and Adobe Photoshop, browse a Windows network and use Unix commands ó at the same time.

1 min read