Posts Tagged ‘Linux’

Leaking process info?

Friday, March 29th, 2013

Wondering how to restrict your users to only see their own processes in Linux? A quick answer that comes up is the grsecurity patch, but that doesn’t cope very well with the apparmor functionality in Ubuntu’s kernel. Fortunately, not long ago Openwall developer Vasiliy Kulikov came up with this kernel patch that allows us to mount the proc filesystem with the hidepid and gid options, achieving this. All the details are supplied at the above link. The patch was imported into mainline kernel 3.3, I believe. As a side note, this has been backported to Debian Wheezy and Ubuntu Precise kernels.

Of course, FreeBSD has a similar option since 4.0, configurable via sysctl.

Small screens

Wednesday, January 23rd, 2013

Openbox. The perfect window manager for netbook screens. No panels, no icons on the desktop, no useless eyecandy, no nothing that would get in the way. Just a simple root menu, keybindings and the dock – should you want to run anything in it. Of course one could also run one of several panels or a fullblown desktop environment. Here’s a guide.

Linux issues

Sunday, November 25th, 2012

Some of the Linux people are unhappy with the direction udev is heading toward (integration with systemd) and have decided to fork it. This discussion also concerns Debian as they are looking to replace sysvinit with something more modern, without breaking compatibility with the other platforms they support – which systemd and upstart do, because they rely on Linux specific components such as udev and dbus. Upstream vendors are pushing changes that break compatibility with other Unix-like platforms such as *BSD. This practice even threatens to further break compatibility between Linux distributions.

Apples and oranges

Sunday, October 21st, 2012

I’ve recently switched jobs and my new employer is using iMacs for Perl development. It’s my first contact with Apple and OS X after being a long time Linux user and also running FreeBSD for more than a decade, along with less and less Windows usage. I won’t insist on Windows since it’s not an Unix family OS. Below are my impressions after two weeks of OS X 10.6 usage for software development.

The good: Nice and responsive graphical user interface. The fonts, the graphics and the quality of the display are beautiful, unlike anything I’ve seen so far. When you run CPU and I/O hogging tasks in the background, the GUI is respnsive and doesn’t lag like Windows or X11 does when you fill up the RAM. Best of all, when you open a terminal you’ll find an Unix-type OS underneath with Perl and Java included in the base OS. You cand also install the chain of development tools via Xcode or get just the command line tools if you only need them instead of the whole IDE. The next logical step is to install the open source software Apple didn’t include via Macports or Homebrew or even pkgsrc. As an IDE we use Eclipse and it runs smooth. Otherwise OS X is user friendly and easy to use. If you want to configure something, it’s usually easy and straightforward. Configuration options aren’t obfuscated and hidden under 5+ levels of menus like in Windows 7.

The bad: Some of the open source packages are not very well supported and break or segfault, like mcrypt did. But that’s alright since they aren’t supported by Apple anyway, right? Missed the RPM hell? Try Macports.

The ugly: While there’s nothing ugly about Macs, the whole Apple box is essentially an appliance. If you just want a high quality computer that does the job at the end of the day, that’s fine. When you want to add hardware, be prepared to buy it from Apple at a premium. You can build a more powerful PC for the same amount of money, but you probably won’t do it inside a monitor or a box as small as the Mac mini.

Fun with urxvt

Wednesday, May 9th, 2012

I recently installed Xubuntu 12.04 LTS. Being a long time command line user I do work a lot with terminals. Xubuntu comes with xfce-terminal by default, which is quite memory hungry. It’s started via the exo wrappers, which enable you to configure different programs than the default ones. You do that via the Preferred Applications dialog menu in Settings Manager.

Rxvt is a lightweight terminal which can run in client-server mode, meaning that you start a server and every new terminal connects to it through a socket. Apart from taking up little memory, this approach further reduces the memory footprint of additional terminals. There is a downside to this – if the server process crashes, all your clients crash with it. So it goes. Urxvt is a fork of rxvt with unicode support and some other goodies. The urxvtcd program starts a server process and subsequent client processes. Below you have a comparision of the memory used by xfce-terminal, a single rxvt process and a urxvtd server process with two client terminals.

1000  3187  0.3  0.7 285928 14604 pts/5    Sl+  18:00   0:00 xfce4-terminal
1000  3177  0.1  0.1  40500  2724 pts/5    S+   17:59   0:00 rxvt
1000  2311  0.0  0.1  41604  3484 ?        S    17:05   0:00 urxvtd -q -f

The trouble is that the Preferred Aplications dialog doesn’t let run the command with arguments. I don’t know if this is a bug or a feature, but you have to resort to a bit of command line magic in order to run urxvtcd with the desired options. The first step is to set urxvtcd as the preferred terminal application and then edit the following file with your favourite editor and alter the X-XFCE-Commands line to run the program with the desired parameters:

$ vim ~/.local/share/xfce4/helpers/custom-TerminalEmulator.desktop
X-XFCE-CommandsWithParameter=urxvtcd -bg black -fg white -fn fixed +sb -tn rxvt -e "%s"
X-XFCE-Commands=urxvtcd -bg black -fg white -fn fixed +sb -tn rxvt

Voilà. Now you can happily run your lightweight terminal every time you click on the Terminal emulator icons in the context menu or on the panel. Of course, this tutorial assumes that you have already installed the rxvt-unicode or the rxvt-unicode-lite package.

Putin says: free software

Wednesday, January 5th, 2011

Russian prime minister Vladimir Putin has signed an order requiring the federal government to move from proprietary technologies to free/open source software. Starting with the second quarter or 2012, Russian federal agencies will be transitioning to Linux-based systems. This decision is most likely motivated by the costs associated with proprietary software, as explained in this article.