Linux volume control from command line and mute/unmute
To Mute:
amixer -D pulse sset Master mute
To Unmute:
amixer -D pulse sset Master unmute
To turn volume up 5%:
amixer -D pulse sset Master 5%+
To turn volume down 5%:
amixer -D pulse sset Master 5%-
Related cards:
How to restore kde klipper confirm dialog to defaults (KDE4)
I asked the same question from myself and it took some time to find a proper solution.
KDE config settings stored in ~/.share/config
and klippers' in ~/.share/config/klipperrc
In that file there is configuration group called Notifica...
TMUX HOME END not working
I had a problem under OpenSuSE 13.1 with tmux 1.8-2.1.2 the home and end buttons did not work. It took me so long to find a solution but finally here it is, original link attached.
There is a nice tool called tput
which can display the key ...
gdiff vim other branch same file
Given you are on the development branch and have another branch my_topic
And want to compare the same file on the two different branches
When open a file in vim say, Gemfile
Then type :Gdiff my_topic
And Vim open Gemfile from my_...
Nicely formatted colored git log
I was struggle to set up a nicely formatted git log for a while. What I wanted to achive is to be able to quickly overlook the history including the
branch structure, authors, time of commits, remote and local branches. Here is what I currently ...
Debug batamanjs model in view context
To inspect a model attributes binded to a dom element
$context($("#elem-id")[0]).controller.model_name.toJSON()
Original idea taken from the link below.
Asssign Batmanjs model option to a select element
Given the following js model:
class MyApp.Post extends Batman.Model
@encode options
Given the server side json (generated with rabl):
object @post
attributes :id, :category
node(:categories) {
Category::OPTIONS...
Force Launcyh to use a specific browser even if running through ssh -X
If using zeus
in that terminal issue the command below:
export BROWSER='/usr/bin/konqueror'
than in another terminal run
zeus cucumber features/holly____.feature
BROWSER will take precedence over xdg-open
and - by using...
Memoization in ruby with nested methods
class Example
def foo
def foo
@bar
end
bar = (1..10).inject(1, :*)
puts "bar is #{bar}"
@wibble = "wibble is #{bar / 30}"
@bar = bar / 20
end
end
example = Example.new
example.foo
bar is 3628800
=> 181440...
ActiveRecord chaining multiple union with Arel
It seems chain uinon with union is possible with newer versions of Arel. But i currently stucked with 3.0.2 so this is what i come up with:
beer = Beer.arel_table
union1 = Beer.where(name: "Oberon").union(Beer.where(name: "Two Hearted"))...
KDE Window Titlebar Missing
If KDE is crash for some reason and not able to restore window's titlebar type this into konsole:
This will restore window titles and redirect further error messages to /dev/null
kwin_x11 --replace & 2> /dev/null