Enable bash completion after sudo command

Standard

If you usually work with the sudo command you will find yourself typing the entire command line after the first word: sudo. That’s pretty annoying and the solution, pretty straight forward.

First of all, we need to install bash-autocompletion package from extra repositories.

That’s all. 🙂

 

Advertisements

Kupfer, a convenient command and access tool

Standard

Today let me show you a lovely piece of software. There are a lot quick launchers out there, but many of them or are somehow buggy or has an almost dead development cycle.

I tried by myself (I think) all of them, because I really hate put my hands out from the keyboard, and I finally get pleased with Kupfer.

For the lazies, see this awesome video tutorial, showing the coolest features.

More documentation can be found on its homepage.

Hope you enjoy it like me! 🙂

No sound at -each- boot!

Standard

Something very annoying began to happen on my work laptop. Every time I booted it, it was without sound.

The sound applet did not work, I could adjust the volume, and detected the sound card, but no sound came out of the speakers.

But the curious thing was I surely heard some youtube video before, so it stopped  from work suddenly…

After recheck my system detected de hardware with lspci, and the right modules were loaded with lsmod

# lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 02)
# lsmod | grep -i intel
snd_hda_intel          31351  6
snd_hda_codec         129274  3 snd_hda_codec_realtek,snd_hda_codec_si3054,snd_hda_intel
snd_pcm                63880  4 snd_hda_codec_si3054,snd_hda_codec,snd_hda_intel
snd_page_alloc          5978  2 snd_pcm,snd_hda_intel
snd                    44598  18 snd_hda_codec_realtek,snd_hda_codec_si3054,snd_hwdep,snd_timer,snd_pcm,snd_hda_codec,snd_hda_intel
intel_agp               8692  1 i915
intel_gtt              10204  3 i915,intel_agp
agpgart                22047  3 drm,intel_agp,intel_gtt

I openned a terminal and execute alsamixer and I saw this:

alsamixer muted device

Those “MM” between the bar and the “100<>100” means that is “Muted”. To toggle between muted and unmuted we must use the “M” key. Then, if you have something playing, it will sound. 🙂

Now we can exit alsamixer by pressing the “Esc” key.

Even if in each reboot, I was again muted, it was very easy open a terminal, unmute the sound card, and done. As that laptop is my job tool, and I did use it mainly to connect to remote servers, to document, or to code some scripts, and rarely to listen music or to watch a video tutorial or something with audio, that worked fine for me… but I admit its annoying.

So, digging a bit deeper, I found alsactl and only by typing

# alsactl store

The configuration will be saved through the reboots 😉

Metro: Last Light black screen problem solved

Standard

I recently bought Metro: Last Light in Steam.

It launched fine but after see the intro and selecting audio and start the game for the very first time, only sound worked, no video at all. Re-launching the game did not help, rebooting the machine didn’t work either. Finally, reinstalling the game didn’t worked as I was afraid, too.

After that first time, I couldn’t even see the main menu or intro… Only the first frame and then a complete blackout.

As suggested somewhere else, I’d installed latest nvidia drivers (331.20), and tested with gnome kde, xfce and blackbox. Nothing at all…. annoying.

I realized, but, that when I pressed Alt+Tab, I could see the image on the KDE’s thumbnail, so the video was there somewhat… so investigating deeper, I finally found the solution.

If you have the same issue, you must edit the user.cfg file, in your steam installed files for that game, usually on:

~/.local/share/Steam/SteamApps/common/Metro Last Light/1100001073fc3fe/

But if you have another destination for your local files or a non-steam edition, make a search for this file where all the game files are.

Once you have this file opened, search for r_gamma parameter. Mine was at 1.5, so I lowered it to

r_gamma 0.5

As easy as that.

Service does not start: ../sysdeps/posix/getaddrinfo.c and rfc3484_sort weird stuff

Standard

I recently installed apache and I found  a lot of problems trying to start it up.  When I did a

# systemctl start httpd
Job for httpd.service failed. See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.
[root@malevo httpd]# systemctl status httpd.service
httpd.service – Apache Webserver
Loaded: loaded (/etc/systemd/system/httpd.service; enabled)
Active: failed (Result: start-limit) since mié 2013-10-16 14:27:11 CEST; 3s ago
Process: 897 ExecStart=/usr/sbin/httpd -k start $OPTIONS (code=dumped, signal=ABRT)

oct 16 14:27:10 malevo systemd[1]: httpd.service: control process exited, code=dumped status=6
oct 16 14:27:10 malevo systemd[1]: Failed to start Apache Webserver.
oct 16 14:27:10 malevo systemd[1]: Unit httpd.service entered failed state.
oct 16 14:27:10 malevo systemd-coredump[898]: Process 897 (httpd) dumped core.
oct 16 14:27:10 malevo systemd[1]: httpd.service holdoff time over, scheduling restart.
oct 16 14:27:11 malevo systemd[1]: Stopping Apache Webserver…
oct 16 14:27:11 malevo systemd[1]: Starting Apache Webserver…
oct 16 14:27:11 malevo systemd[1]: httpd.service start request repeated too quickly, refusing to start.
oct 16 14:27:11 malevo systemd[1]: Failed to start Apache Webserver.
oct 16 14:27:11 malevo systemd[1]: Unit httpd.service entered failed state.

So  Itried to start it manually…

[root@malevo httpd]# httpd
httpd         httpd.itk     httpd.worker
[root@malevo httpd]# httpd
httpd: ../sysdeps/posix/getaddrinfo.c:1741: rfc3484_sort: Assertion `src->results[i].native == -1 || src->results[i].native == a1_native’ failed.
Abortado (`core’ generado)

getaddrinfo? What on earth could mean that?  I did search then and find some hints: first of all, is no apache-related issue, there are a lot of programs can be affected, like java, squid, or whatever…. the common mistake is to think in a corrupted glibc, or duplicate hostname on /etc/hosts… none of them could be the problem, because all other things worked and compiled, so glibc was working as expected, and after take a look inside /etc/hosts, I saw only the entry

127.0.0.1 localhost.localdomain localhost

So I digged even deeper on the Web, and finally found this bug (on glibc) .

The solution is to remove from /etc/nsswitch.conf “myhostname” from this line

hosts: files dns myhostname

Now apache starts as expected. 🙂