Categories: Linux

Audio mute/unmute hotkey on HP DV6-2137sl with Slackware/Linux

Categories: Linux, Slackware
Published on: July 6, 2011

It could be useful sometimes, so…
Use xev to know the code generate by the button, type xev in a terminal and after a bit of some unnecessary codes, press the audio button, you will see something like this:

KeyRelease event, serial 34, synthetic NO, window 0x3800001,
root 0x15d, subw 0x0, time 7145078, (-71,-326), root:(523,0),
state 0x10, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

The important part is keycode 121, in my case.
Create the file ~/.xmodmaprc and put in it:

keycode 121 = F24

F24 is an arbitrary code chosen by me, you can use whatever you want but i suggest F+number, greater than 12.
Now install xbindkeysrc, you can find it at slackbuilds.org, compile and install.
Then do

xbindkeys --defaults > /home/simplex/.xbindkeysrc

to create the default configuration.
Add the part for audio mute/unmute at the bottom:

# Muto
"amixer -c 0 sset Speaker,0 toggle"
m:0x10 + c:121
Mod2 + F24

Replace the 121 and F24 with your codes, the part in “” is the command that you want to run when the button is pressed, in this case the mute/unmute of our notebook speakers.
Next time, the volume bar!

Bash doesn’t like filename with spaces

Categories: Linux
Tags: ,
Published on: June 11, 2011

So in our loop we use it like a string

for file in *.txt; do mv "$file" /tmp/; done

find: remove directories from output

Categories: BSD, Linux
Tags:
Published on: April 9, 2011

To remove the full path to your find results add:

-exec basename {} \;

to your search:

bash-4.1$ find . -type f -name "*.pdf" -exec basename {} \;
FreeBSD_Portability_With_VMware_BSD_04_2011.pdf
Network_Security_Hakin9_02_2011.pdf

Apache: _default_ VirtualHost overlap on port 443, the first has precedence

Categories: BSD, Linux
Published on: April 8, 2011

If you have just added another VirtualHost with SSL and Apache is giving to you this error:

[warn] _default_ VirtualHost overlap on port 443, the first has precedence

Probably you miss a

NameVirtualHost *:443

at the top of your httpd-vhosts.conf file.

bash cgi: malformed header from script. Bad header=<html>

Categories: Interwebz, Linux
Tags: ,
Published on: April 6, 2011

Look if you have a \n somewhere:

echo "Content-Type: text/html\n\n"

Substitute it with:

echo "Content-Type: text/html"
echo ""
echo ""

«page 2 of 5»
Please support our sponsors ;)
Welcome , today is Sunday, May 20, 2012