background preloader

Linux

Facebook Twitter

Upgrade Debian 6.0 Squeeze to 7.0 Wheeze. Upgrade Debian 6.0 Squeeze to 7.0 Wheezy Written by Guillermo Garron . Date: 2012-08-14 13:09:30 +0000 Spanish version I’ve a fresh Debian 6.0 (Squeeze) installation, and have decided to upgrade it to Wheezy (Debian 7.0). First you need to know that even though in previous versions aptitude has been recommended, in this version apt-get is the recommended command to work with. You can read (and it is better if you really do it) the full and official instructions here. But, if your system is not that critical, or if you have somehow a “clean” system. First thing you need to do, is backup all important information you may have. Prepare sources.list You can use your favorite text editor, to open /etc/apt/sources.list file. vim /etc/apt/sources.list And change squeeze for wheezy, it may look like this after the change: As I’ve told you, my system is very clean. Upgrade the system Respecting what the official how-to says, we’ll do the upgrade in stages.

Update the sources apt-get update Minimal upgrade Bio.

Bash

All about Linux swap space. By Gary Sims Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available. Swapping is necessary for two important reasons. First, when the system requires more memory than is physically available, the kernel swaps out less used pages and gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache. However, swapping does have a downside.

Linux has two forms of swap space: the swap partition and the swap file. Fdisk -l /dev/hdb. Hypervisors, virtualization, and the cloud: Learn about hypervisors, system virtualization, and how it works in a cloud environment. Virtualization improves IT resource utilization by treating your company's physical resources as pools from which virtual resources can be dynamically allocated. Virtualization involves a shift in thinking from physical to logical, treating IT resources as logical resources rather than separate physical resources. Using virtualization in your environment, you are able to consolidate resources such as processors, storage, and networks into a virtual environment which provides the following benefits: Consolidation to reduce hardware cost.Optimization of workloads.IT flexibility and responsiveness.

Virtualization is the creation of flexible substitutes for actual resources — substitutes that have the same functions and external interfaces as their actual counterparts but that differ in attributes such as size, performance, and cost. Furthermore, virtual resources can have functions or features that are not available in their underlying physical resources. Figure 1. Hypervisors in general. Kurt Seifried - information security.

Linux 101

Ssh. Learn Linux, 302 (Mixed environments): SWAT configuration. Overview In this article, learn about these concepts: Overview of Samba Web Administration Tool (SWAT) featuresInstalling and setting up SWATUsing SWAT to configure Samba This article helps you prepare for Objective 312.5 in Topic 312 of the Linux Professional Institute's (LPI) Mixed Environment specialty exam (302). The objective has a weight of 4. Back to top Prerequisites This article assumes that you have a working knowledge of Linux command-line functions and that you understand the basics of Samba configuration. Installing and running SWAT In Samba version 3.x, SWAT is a separate server from the two main Samba servers, smbd and nmbd.

Note: Samba 4, which is still under development, makes some major architectural changes, including major changes to SWAT. Installing SWAT If you build Samba from source code, as described in Objective 311.1, SWAT should be built by default and installed along with other Samba components. With SWAT installed, you can move on to running it. Listing 1. Improve Nagios Performance -using RAMDISK | LinuxReaders. Linux / UNIX List Just Directories Or Directory Names. How do I list just directory names under Linux and UNIX operating systems? Under Linux or UNIX use the ls command to list files and directories. However, ls does not have an option to list only directories. You can use combination of ls and grep to list directory names only. Display or list all directories Type the following command: $ ls -l | egrep `^d' Display or list only files Type the following command: $ ls -l | egrep -v `^d' grep command used to searches input.

Task: Create aliases to save time You can create two aliases as follows to list only directories and files. alias lf="ls -l | egrep -v '^d'" alias ldir="ls -l | egrep '^d'" Put above two aliases in your bash shell startup file: $ cd $ vi .bash_profile Append two lines: alias lf="ls -l | egrep -v '^d'" alias ldir="ls -l | egrep '^d'" Save and close the file. Now just type lf - to list files and ldir - to list directories only: $ cd /etc $ lf Output: List directory names only: $ cd /etc $ ldirOutput: find command Sample outputs:

Using Top More Efficiently Linux article. Among many monitoring tools that available, most people use "top" (a part of procps package). Top provide almost everything we need to monitor our system's resource usage within single shot. In this article, all the information are based on procps 3.2.5 running on top of Linux kernel 2.6.x Here, we assume that procps package is already installed and run well in your Linux system. No previous experience with top is needed here, but if you had given it a try briefly, that would be an advantage. Here are some challenges: A. Interactive or batch mode?

By default, top is invoked using interactive mode. . $ top -b You will get output like below: Uh, wait, it runs repeatedly, just like interactive mode does. . $ top -b -n 1 The real advantage of this mode is you can easily combine in with at or cron. . $ cat . Careful reader might ask "why do I need to set TERM environment before invoking top when creating new at job? ". B. . $ top -p 4360,4358 $ top -p 4360 -p 4358 $ top -u johndoe $ top -u 500 $ top -U johndoe. Learn Linux, 101: Manage file permissions and ownership. Overview In this article, learn to control file access through correct use of file and directory permissions and ownerships. Learn to: Manage access permissions on both regular and special files as well as directoriesMaintain security using access modes such as suid, sgid, and the sticky bitChange the file creation maskGrant file access to group members Unless otherwise noted, the examples in this article use Fedora 13 with a 2.6.34 kernel.

Your results on other systems may differ. This article helps you prepare for Objective 104.5 in Topic 104 of the Linux Professional Institute's Junior Level Administration (LPIC-1) exam 101. We introduced some of the file and group ownership concepts of this article in our previous article "Learn Linux 101: Manage disk quotas. " Prerequisites To get the most from the articles in this series, you should have a basic knowledge of Linux and a working Linux system on which you can practice the commands covered in this article. Back to top User and groups. Customizing the vi and Vim editors. The vi text editor (or a workalike clone) has been included as part of every UNIX and UNIX-like system since 1978.

Due to AT&T licensing restrictions, UNIX-like open source systems had to write their own vi clones from scratch, which led to vi workalikes such as Elvis, nvi, and Vim (the latter of which is discussed in this article along with the original vi). This ubiquity makes it one of the truly indispensable tools for a system administrator of any UNIX, Linux, Berkeley Software Distribution (BSD), or other UNIX-like computer system. Fans of the Emacs text editor on UNIX and UNIX-like systems, myself included, delight in its flexibility, expandability, and configurability. This article highlights those same capabilities in vi and its most popular clone, Vim. This article explains how to customize vi and Vim, not how to use them. Types of vi and Vim customizations Table 1. You can intersperse configuration commands and comments within the command in a vi or Vim configuration file. Three locks for your SSH door. Introduction If you require remote access to your computer and you enable Secure Shell (SSH) connections, you must accept that you will automatically attract hackers who will try to break your defenses and take command of your machine.

Although there's no guarantee that your machine won't be "0wn3d" by a "h4x0r," a few simple solutions can help reinforce your SSH door and make life a bit more difficult for anybody trying to break in. This article considers three such techniques: Changing SSH's standard port to an unusual value and reinforcing SSH configuration so that simple-minded attacks just bounce back. To apply these techniques, you need to access the root account. Back to top Reinforcing the door The concept "security through obscurity" is well known—and well derided—because doing things in an obscure way, hoping that no one will get wise to your method, is just asking for problems.

Everybody knows that the standard port for SSH connections is 22. Ssh -p 22960 your.machine.url. PHP Advent 2010 / Managing LAMP. One of the things that initially attracted me to PHP was that I could write all of my apps in pure PHP, and they would run anywhere I deployed them. Yeah, right. I was young and dumb back then, and I’ve learned a lot in the meantime. One of the things that I’ve learned is that your environment is incredibly important. A misconfigured setting is probably the biggest reason that code deployments fail. It’s so important that it’s almost universally recognized that if your code has any complexity, you need a staging server to test your code in a production-like configuration before you push out your releases. There are a plethora of tools available to help you manage these jumps from development to staging to production.

What is examined less often — and in much less detail — is how to manage configuration files. Luckily, there’s a convenient file archive management system in front of you right now. This system is your Linux distribution’s package manager. Package An arbitrary package name. . #! Setup Ubuntu to browse Windows network by hostname. By default, a Ubuntu desktop with Samba installed will be a member of the Windows workgroup named WORKGROUP. Because that machine is a member of WORKGROUP, you would think you could browse and connect to other machines on the same network by hostname. That is not the case.

Instead you would still have to locate a machine's IP address in order to connect. This seems to defeat the purpose of Samba and the ability to join a workgroup. To make life easier you need to, after installing Samba, make a fairly straight-forward change that will then allow your machine to see and reach other machines by hostname. Let's see how this is done. Samba Naturally you need to have Samba installed on the machine you plan on using. Once Samba is installed you can double check to make sure the Workgroup is correct by opening up the file /etc/samba/smb.conf and looking for the line: workgroup = WORKGROUP If you want (or need) to change the workgroup you belong to, change it there. Sudo service smbd restart.

How To Send Desktop Notifications on Ubuntu Using notify-send. Notify-send command sends notification to the desktop. It is non intrusive. It does not ask user to press ok, and it does not take any control away from the user. This article explains how to send various types of desktop notifications using notify-send program. 1. Notify-send can be used to send simple notification as shown below. $ notify-send 'Title of the message' 'Text of the message' Fig: Simple desktop notification 2.

Notify-send can be used to send notification along with an icon using -i option. $ notify-send -u critical -i "notification-message-IM" 'Boss !! ' notification-message-IM is a type of icon that can be used in the notify-send program. To view all available notification icons, refer to the Notify send guidelines (under the section “How do I get these slick icons”). Fig: Notification with IM icon 3. You can use your own custom icon using the notify-send -i option as shown below. $ notify-send -i /home/sathiya/deal.ico 'Deal success' Fig: Notification with your custom icon 4. 5.

Learning Vim. In an attempt to familiarize myself with the unfamiliar, I decided to build a fun side-project in Ruby and Vim. Effectively learning a new language, framework, and editor. Coming from Nano, Quanta, Eclipse PDT, TextMate, Netbeans; I found (Mac/g)Vim is big a step, and first two weeks you should not expect to be productive. But after some persistence, I'm now faster in Vim than I was in my previous editors. Except for NetBeans still. Maybe that changes as I get better, but having an editor that understands your code is also a powerful thing. Scope-aware refactoring and jumping to declarations make that I keep both NetBeans and Vim around.

Investing in a tool like this pays off. Cause as so long as computers can't read our minds, we're better of maximizing the efficiency of our typing. Here are the resources that helped me get started with Vim. Vim screencast tutorial (awesome series): Other screencasts: Top Vim Plugins More resources: Mode switching Command mode Normal mode Movement / Motions ! Interactive map of Linux kernel.

Web Hosting Search – Find the best website hosting plans and web hosts. Learn Linux, 101: Manage disk quotas. Overview In this article, learn to manage disk quotas for users. Learn to: Set up a disk quota for a filesystemSet quota limitsCheck quotasGenerate quota reports Unless otherwise noted, the examples in this article use Fedora 13 with a 2.6.34 kernel. Your results on other systems may differ. This article helps you prepare for Objective 104.4 in Topic 104 of the Linux Professional Institute's Junior Level Administration (LPIC-1) exam 101. Prerequisites To get the most from the articles in this series, you should have a basic knowledge of Linux and a working Linux system on to practice the commands covered in this article. You should also be familiar with the material in our article "Learn Linux 101: Create partitions and filesystems. " Back to top Introducing quotas Quotas allow you to control disk usage by user or by group.

Quotas must be enabled and managed by the root user or by a user with root authority. There are three different types of quota support: XFS quotas are always journaled. Print all the lines between 10 and 20 of a file. Command to logout all the users in one command. CPU architecture details. Kill all process that belongs to you. Watch and keep history of a command. Display the ttl of a hostname in a human readable form. Find all file larger than 500M. Learn Linux, 101: Control mounting and unmounting of filesystems. Overview In this article, learn to: Mount and unmount filesystems manuallyConfigure filesystem mounting on bootupConfigure user-mountable, removable filesystems such as tape drives, external USB drives, floppies, and CDs or DVDs This article helps you prepare for Objective 104.3 in Topic 104 of the Linux Professional Institute's Junior Level Administration (LPIC-1) exam 101.

The objective has a weight of 3. Prerequisites To get the most from the articles in this series, you should have a basic knowledge of Linux and a working Linux system on which you can practice the commands covered in this article. You should also be familiar with the material in our article, "Learn Linux 101: Create partitions and filesystems. " Back to top Mounting filesystems The Linux filesystem is one big tree rooted at /, and yet we have filesystems on different devices and partitions. Besides filesystems on partitions, floppy disks, and CDs, there are other types of filesystems. Listing 1. Listing 2. Listing 3. Notes: Capture mysql queries sent to server. 10 things you can do when the drive on your Linux box is full | 10 Things | TechRepublic.com.

Macbuntu Makes Your Linux Desktop Look Like Mac OS X.