Nov 30, 2013

Debian and XFCE: Print Screen Key

Print Screen Key

To enable the print screen key, just head on to Application Menu > Settings > Keyboard and click on the Application Shortcuts tab.

Add a new command and in the text box enter in the following:
xfce4-screenshooter -f
Hit Ok, and the next dialogue will require you to enter in the key (or key combination) that will trigger this command (in this case, we will press the 'Prt Scr' key).


References:

Nov 29, 2013

Notes for Think Again: How to reason and argue (Lectures 3 Validity and Soundness)

These are my course notes for the Coursera course "Think Again" by Walter Sinnott-Armstrong at Duke University and Ram Neta at University of North Carolina.

This follows on from my earlier notes.

VALIDITY

Remember that arguments consist of premises and conclusions, and these are supposed to be related in a good argument. We need some standards for evaluating arguments (so we can deconstruct, reconstruct and create our own). Two standards for evaluating arguments are 'Valid' and 'Sound'.

There are 2 main reasons for arguments to go wrong:
  • One or more premises are wrong or false
  • The premises do not provide a good reason for the conclusion

Remember the relation between premises and conclusions.
  • DEDUCTIVE: Conclusion follows from the premises. Trying to be valid.
  • INDUCTIVE: Argument is not supposed to be valid. Conclusion does not follow from premises.

The rule for validity is:
An argument is valid if and only if it is not possible that both all of its premises are true and its conclusion is false
This means that there can be no way both premises come out true when the conclusion is false. This stands if you assume that the conclusion is false and then test the premises; if they still remain true while the conclusion is asserted false, then it is NOT a valid argument.

This test helps us determine if the premises actually support the conclusion. Another way to look at it is that an argument is valid if and only if whenever its conclusion is false, at least one premise must also be false.

A valid argument is not:
  •  necessarily good. An argument can be valid but be no good at justifying or explaining the conclusion
  • dependent on whether the premises and the conclusion are actually true. It is only dependent on what is possible.
Validity in this context is simply a technical term. Validity should not be confused with other types of validity.

SOUNDNESS

A sound argument is one where the conclusion must be true.


An argument is sound if and only if:
  • all of its premises are true
  • it is valid
If the premises are true and the argument is valid, then the conclusion must be true because if it is false then one or more of the premises must also be false (as per the conditions of validity).

If a deductive argument is not sound, then it is not a good argument (because a deductive argument is trying to be valid, with the conclusion following from it's premises).

BASICS OF RECONSTRUCTION

The goal of reconstruction is to put an argument in a form in which we can easily and accurately assess it in as fair a manner as possible.
  1. Do a close analysis
  2. Remove all excess verbiage
  3. List all explicit premises and conclusion in standard form
  4. Clarify where needed (Sharpen edges)
  5. Break up where possible without distortion
  6. Divide the argument into sub-arguments, and arrange them in order
  7. Assess whether each argument is valid
  8. Add suppressed premises where needed
  9. Check each premise for truth
  10. Qualify premiese to make them true where needed if possible
  11. Assess the argument.
If we manage to reconstruct a sound argument, we know that the conclusion is true. If it is unsound, is it the fault of the argument or ourselves because we didn't understand the argument?

Excess verbiage includes:
  • People repeating themselves for rhetorical effect, stalling for time, or filling in the time
  • Road markers -> help keep track of an argument (what we are talking about, and why). They don't offer anything additional to the argument. Includes changing topics.
  • Tangents -> anecdotes and stories that make the argument interesting or memorable, but offer no reasons for the argument. They can also try to fool or distract you (red herring)
  • Examples -> trying to highlight or bring to home the point of the argument. However, the example may just be an outlier. It can sometimes be used as a premise for the argument.
You need to be careful when removing excess words (including assuring, guarding and other words), because if you remove too much you may make the argument worse and not true to the intentions of the original speaker.

Nov 4, 2013

Debian: Installing gitolite

Tried setting up gitolite in Debian following my earlier guide with CentOS, but it didn't work out as well because there were a few steps missing (Debian doesn't create the gitolite user automatically). These are the modified steps:

  1. Install gitolite:
    sudo apt-get install git git-core python-setuptools gitolite
  2. Add the gitolite user (this is the user that will host the git repositories and control access):
    sudo useradd gitolite
  3. As the user who will be administrating the set-up (i.e. someone OTHER than the gitolite user), create a set of ssh keys and move them to where the gitolite user can access them:
    ssh-keygencp ~/.ssh/id_rsa.pub /tmp/admin.pub
  4. Switch to the gitolite user:
    sudo su - gitolite
  5. Run the set-up command:
    gl-setup /tmp/admin.pub
  6. As the user who will be administrating the set-up, clone the repository
    git clone gitolite@[ip address]:gitolite-admin.git
You can now add in other keys and set up the configuration of gitolite.

References:

Nov 3, 2013

Debian and XFCE Dual Monitors

Open up a terminal and type in xrandr. This will output the configuration of the currently connected monitors. Identify the names of your monitors (such as HDMI2, LCD1, VGA1, CRT2 or whatever). In this example we have two monitors, HDMI1 and HDMI2.

Now type in the desired layout:

xrandr --output HDMI2 --left-of HDMI1
The monitors should now be showing your desired screen laytout. If not, play around until you have it.

To make this layout permanent, click on the Start menu > Settings > Session and Startup and then click on the Application Autostart tab. Add a new autostart item and then insert the xrandr command into the Command text field. Now if you restart your settings will be automatically loaded!

References

Nov 1, 2013

Debian: Sound issue

I had a bit of an issue with ALSA and Debian in regards to my sound device not being detected properly. This meant I had to dig around a bit to get it up and running.

Note that with this method may not work nicely with multiple sound cards. Your mileage may vary....

Problem:

Running the command alsamixer in a terminal returned this error message:
cannot load mixer controls: Invalid argument
Trying to restart the ALSA server got me this:
root@localhost:~# /etc/init.d/alsa-utils stop
[....] Shutting down ALSA...warning: 'alsactl store' failed with error message 'alsactl: get_control:250: Cannot read control info '2,0,0,Front Playback Volume,0': In[FAIL argument'...failed.
So there was something wrong with the system configuration or the control.

For reference, this is what my system has configured:

root@localhost:~# head -n 1 /proc/asound/card0/codec*
==> /proc/asound/card0/codec#2 <==
Codec: Realtek ALC887-VD

==> /proc/asound/card0/codec#3 <==
Codec: Intel PantherPoint HDMI
 root@caesar:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Explanation of these commands (skip if you want to get to the solution)

The first command reads out the first line (head -n1) of each of the files that match the search pattern (/proc/asound/card0/codec*). This matches two files (codec#2 and codec#3). The /proc/ filesystem is where Linux stores all the files necessary for running the operating system, including detected hardware devices. The first file tells us that the system recognizes the motherboard sound card, and the second files recognizes the HDMI output.

The second command confirms our suspicions, and also let's us know that ALSA detects these devices too (the Realtek and the HDMI devices are found and configured).

Now we know that the problem lies in the ALSA configuration, because everything is detected at this stage.

Solution:
  1.  Run the following command and look for your audio device:

    lspci -v
  2. The above step is important because you need to find the line 'Kernel driver in use' associated with your Audio controller (which is outputted by the above line). In my case the kernel was using snd_hda_intel.
  3. Now we need to check to ensure the driver is installed. A simple way is to start off writing (DO NOT PRESS ENTER YET!) modprobe snd and then tab complete it (press the <TAB> key twice). This should bring up a list of sound drivers your system knows about. If your driver is not listed you should try to find and install it.
  4. Edit /etc/modprobe.d/alsa_base.conf and add the following line (you may need to adjust this to suit your system):
    options snd-hda-intel model=generic
  5. Now we need to force ALSA to load the new configuration:
    alsa force-reload
  6. If you can hear sound after running the following command, congratulations!
    aplay /usr/share/sounds/alsa/Front_Center.wav

References: