Entries tagged as shell

Programmatically limit CPU usage of certain processes

Posted by | Comment (1) | Trackbacks (0)

With KDE 4.10 the file indexer has undergone some major changes which made it pretty usable so I decided to switch it on again. It turned out that the first stage indexing works exceptionally well. It indexed about 60,000 files in my home directory in the blink of an eye.

Unfortunately, I had to realize that the second level indexing does not work so well. I remember Virtuoso often eating up all my CPU in the past. Now Virtuoso keeps quiet, but nepomukindexer let's my workstation fly. It only starts indexing when my PC is idle, but for bigger files it keeps the CPU busy at a level of 100%, which is a pretty bad thing. There is already a Bug report about nepomukindexer consuming too much CPU time on larger files, but I didn't want to wait for a fix.

Long story short: I thought of ways to automatically limit the CPU usage of certain processes (not necessarily only Nepomuk).

Read more…

Hacking embedded systems

Posted by | Comment (1) | Trackbacks (0)

Linux is everywhere, not just on desktops. It's on phones, ebook readers, on public terminals, on routers, on electricity meters and many more devices. The key to Linux' success is it's diversity. It is possible to run Linux on nearly every technical device that has a CPU. Many of these are closed systems, so often you don't even notice that Linux is running on that particular device, but there is always a way to gain access to its internals and modify it the way you want. But often you have the problem that heavy modifications might void your warranty or make updates to a more recent firmware version impossible. In this article I want to show you a simple but powerful way to modify such systems in a non-destructive way.

Read more…

ZSH Gem #24: ZSH frameworks

Posted by | Comments (7) | Trackbacks (0)

I have shown you many things about ZSH throughout this series, but there is much more you can do with it than I could cover here. And of course there is also much more to configure, many more options I couldn't tell you about, many more tips and tricks, tweaks and optimizations.

Generally, it's a long way to go before you have your shell set up as you like. Especially ZSH needs a lot of configuration before it becomes very user-friendly. You can do all this configuration by hand or you can use a framework for that. Yes, there are frameworks for ZSH (and for Bash as well, in case you didn't know) and as a completion of this Advent series I'll show you two of them.

Read more…

ZSH Gem #23: Working with extended regular expressions

Posted by | Comments (0) | Trackbacks (0)

There are two ZSH modules which allow you to easily work with POSIX extended regular expressions (POSIX ERE) or with Perl compatible regular expressions (PCRE) which are even more advanced than POSIX ERE. These two modules are zsh/regex and zsh/pcre. You can use either one of them or both at the same time. That's entirely up to you. I'll show you both.

Read more…

ZSH Gem #22: Accessing and editing files with mapfile

Posted by | Comment (1) | Trackbacks (0)

Working on the shell is often working with files and sometimes you need to read or edit their contents. Normally you'd do that with the command line editor of your choice (e.g. nano, vi, vim or emacs), but sometimes you need to write the output of a command or a pipe to a file or feed programs with contents from the hard disk. That's usually done by using the input and output redirection operators, but ZSH gives you one more tool which can sometimes make things easier. This module is called mapfile.

Read more…

ZSH Gem #21: Completion of abbreviated filenames

Posted by | Comments (0) | Trackbacks (0)

Yesterday I told you about how to use the full potential of the cd command. Today I want to go one step further and show you how you can reduce the number of characters to type even more.

As I've already shown you several times throughout this series, ZSH is very capable of completing things when hitting the TAB key. Today I'll show you two more features concerning completion of abbreviated or incomplete pathnames.

Read more…

ZSH Gem #20: Changing directories the pro's way

Posted by | Comments (2) | Trackbacks (0)

I guess, the cd command is the most often neglected command. Nobody really cares about what this command can do, but in fact, ZSH has added some magic to it, which makes it worth a more thorough look.

I told you about AUTO_CD before, a shorthand syntax for the cd command. But that's not the only thing ZSH has done to cd.

Read more…

ZSH Gem #19: Global aliases

Posted by | Comments (2) | Trackbacks (0)

I guess each shell implementation knows something like aliases. With aliases you can give commands different names which might be more convenient for you. That's nothing new, but ZSH has a feature called global aliases.

Read more…

ZSH Gem #18: Regexp search and replace on parameters

Posted by | Comments (0) | Trackbacks (0)

In ZSH you can easily perform regexp search and replace operations on shell parameters. The only function you need for this is regexp-replace.

Regexp search and replace can be very useful when writing shell scripts which need to process input data, directory names, process trees etc. You assign the string which you need to work on to a parameter and then run the replace function on it.

Read more…

ZSH Gem #17: Changing directories with auto_cd

Posted by | Comment (1) | Trackbacks (0)

This is probably the shortest tip of this series. I only want to show you a ZSH-specific shorthand for changing directories.

The ZSH option AUTO_CD makes it possible to change directories by just writing their names without using cd. This might be interesting for those of you who always want to type as few characters as possible.

Read more…

(Page 1 of 3, totaling 25 entries)
Design and Code Copyright © 2010-2014 Janek Bevendorff Content on this site is published under the terms of the GNU Free Documentation License (GFDL). You may redistribute content only in compliance with these terms. tweetbackcheck