Changing Linux Folder Permissions

October 30, 2010

Recently I copied an entire directory of Music from my mp3 player onto my ArchLinux install. In so doing I had to sudo mount the device so the files copied all had root permissions. This was rediculous when moving files etc. but I didn’t know how to change permissions from the cli, which is all I’m using as a file manager. So here’s how you do it:

ls -l
Displays info on the files/directories.

In order: 10 spaces determining file permissions, size, owner, group, date and time of last change, name.
I wanted to change owner and group to my user name and the group to users. To find out what group you want, use ls -l in a directory where you already have the permissions you want, or if such a place doesn’t exist then:

groups yourusername

will contain the groups the user is a member of.
Anyway, to change the owner:

chown yourusername thefilename

For me I wanted it to change an entire directory of files so:

chown -R yourusername *

Then the group change with recursion included:

chgrp -R yourgroupname *

Hey presto you changed the permissions on all the files, also any file created here will have the new permissions. You could also use this to add security or nuisance when you have to sudo every renaming or file move.


Xorg Modeline Benq g2222hdh

August 26, 2010

I recently upgraded my computer and learned enough about modelines that might be of help.

The modeline I’m using for the Benq G2222hdh monitor is:

Modeline "1920x1080_60.00" 148.5 1920 2008 2052 2200 1080 1108 1113 1125 -hsync +vsync

I couldn’t use xvidtune as I got an “unable to query monitor information” error. So I manually adjusted it using the two numbers immediately following the horizontal and vertical refresh rates. i.e. 2008, 2052 and 1108 1113. The numbers in each set were increased by the same amount, eg. 2011 2055, restarting Xorg in between each adjustment, to check, so that I got them in a position I was happy with.

If you need a modeline for your max resolution then open up the Xorg log:

vim /var/log/Xorg.0.log

Somewhere you will find a line beginning:

h_active:

This line the one immediately preceding and the one following it contain the numbers you need for the modeline. Mine looked like this:

[ 7343.008] (II) RADEON(0): clock: 148.5 MHz Image Size: 477 x 268 mm
[ 7343.008] (II) RADEON(0): h_active: 1920 h_sync: 2008 h_sync_end 2052 h_blank_end 2200 h_border: 0
[ 7343.008] (II) RADEON(0): v_active: 1080 v_sync: 1084 v_sync_end 1089 v_blanking: 1125 v_border: 0

Ignore h/v_border and Image Size. The modeline of the above output would be:

Modeline "1920x1080_60.00" 148.5 1920 2008 2052 2200 1080 1084 1089 1125 -hsync +vsync

Figuring it out from here is trivial.


Word to Tex conversion Archlinux

June 14, 2010

At first I tried catdoc but I couldn’t get it to output to vim, which may have been my fault.

Then I tried wv2-svn but it didn’t instll properly.

So I used pacman to find the abiword converter and downloaded that.

pacman -S wv

http://wvware.sourceforge.net/ lists the apps that come with it.

wvLatex input.doc input.tex

and it was done. Now I can use my word documents in arch.


Ubuntu Window Border

May 1, 2010

This might be useful and was partly pillaged from ALIENDUDE5300 from this thread.

In Lucid Lynx the Border Icons have been moved from right to left. Presumably to prevent unwanted window closure. However, this system is just as likely to fail so enter the below and you should have close on the left and everything else on the right. No more accidental window closures.

add this to the terminal assuming you don’t have a different wm :

gconftool-2 --set "/apps/metacity/general/button_layout" --type string "close:minimize,maximize"


An Overview Of IQ

August 18, 2009

Anyone can have an IQ?

Firstly, you need to find out your IQ. The easiest way to do this is to do a lot of IQ tests then use the highest within a range around your mean score. i.e. your highest average score.

So that scores of 120, 125, 128, 130, 155, would place your IQ at about 130.

The reason you take a lot of tests is that measuring IQ is like setting a world record in sprinting you get as many chances as you like because you can’t outrun, nor outscore, yourself.

Secondly the reason you take a highest average is that almost all the IQ tests you find from a google search for IQ tests will inflate your score to such a degree as to skew your actual score.

Using this method can take a long time, as the more tests you take the higher your scores will get until you reach a peak which is similar to practicing running before attempting to set a record, but the results are very accurate.

It’s telling me I’m a genius.

If at this stage, or any other, your scores seem to be hitting around 135 – 145 then I suggest doing tests that are linked to from this site here.

These tests are designed for high IQ scorers and will provide more accurate results.

I know my IQ!

Skip to a few months later and you have finally found out your IQ. Remember to find out what scale they used on each test before you find the mean.

There are three common scales. Weschler  S.D. 15, Stanford-Binet S.D. 16, and Cattell S.D. 24.

S.D. is an abbreviation of standard deviation which is the numerical value they give to sigma based on probability. So that S.D. 15 has 68.4% of the population within 85 – 115 IQ and S.D. 24 has 68.4% within 76 – 124 . As such the numbers do not correlate with one another at all. So it’s really just better to use percentiles or sigmas.

I still know my IQ!

So at this stage you should visit this site here.
Just input your score, depending on the scale, in the box provided and hey presto! you will get everything you need. Percentile, Sigma, IQ to SAT and GRE and best of all a population number.

Millions of Genii?

Well if you’re still interested you might want to find out how you compare in your country, profession, income bracket, level of education.

In fact this is really the only thing left to do other than fix your life or someone elses with that big ole’ brain of yours.

This is really simple all you do is:

(100 – mean IQ of group) + ( your IQ)

this is your IQ in relation to the group. So put this score depending on the scales used into the calculator linked above and you will have your percentile in comparison.

e.g. 150 IQ S.D. 15 who lives in Bulgaria mean IQ 93 S.D. 15

(100 – 93) + (150) = 157 (S.D. 15) is 99.9931 percentile which is a rarity of 1/14533

So pop. Bulgaria ( 7 262 675) / rarity ( 14533) = 500

Therefore, this person has 500 people of greater or equal intelligence in their country.

It’s lonely at the top.

Misanthropy is the lowest form of intellect. Grow a pair!


Setting Up Jack with Rosegarden and Qsynth

August 11, 2009

Step 1
Install qsynth, which should simultaneously install fluidsynth, the actual synth engine.
Install Jack and qjackctl the gui.
Install your preferred sequencer, in this case I am using rosegarden.
Download a Soundfont for your synth. Google will provide plenty of these.

Step 2
Launch QSynth and ignore the error about Jack for the moment. Click Setup on the bottom left and make sure Jack is the Audio driver under the Audio tab. Next click the Soundfonts tab and find and select the soundfont you downloaded earlier. Now exit QSynth.

Step 3
Launch Jack. Click setup and select alsa as the driver. Then click the > symbol beside interface and select your audio card. Close the setup screen and click Start. If you encounter errors about buffer size then change the Frames/Period and Periods/Buffer settings in Setup. Otherwise you should see that Jack is now running.

If you get an error about realtime scheduling then you need to edit the /etc/security/limits.conf
and add :
@audio    -    rtprio 99
@audio    -    memlock 512000
@audio    -    nice  -10
You can set the memlock to a different value if you prefer.

Then open System > Administration > Users and Groups and create a new group called audio. Then make the users who are going to use Jack a member of this group.

*N.B.* You should restart your computer now as it may save alot of headaches with errors. *N.B.*

Step 4
Launch Jack and start it.
Launch QSynth next and it should start automatically.

Step 5
Launch Rosegarden and ignore the error about realtime configuration, however, you may want to follow the instructions regarding any error about sequencer modules.

Step 6
Open the Jack Connections screen and disconnect all on the Audio and Alsa Tabs. Then reconnect the following :
Audio Tab – Connect qsynth output to system input
Alsa Tab – Connect rosegarden output to fluidsynth input(i.e. qsynth).

In Rosegarden select Midi output system device in the playback parameters on the right of the screen.
Next open Studio > Manage Midi-Devices and select Synth input port under General midi device and Midi output system device.

Step 7
Play some notes in Rosegarden and it should work. Otherwise you should be able to troubleshoot by knowing that the little green button on QSynth will flash everytime a note in Rosegarden is played if the two are connected properly.

Abstract notion: Jack, therefore, is a connections manager. So the most important thing to bear in mind is that the output from the final device in your chain, in this case the synth but it could be a DAW etc., should connect to your system input. Because the system input OUTPUTS as sound from your speakers.

Hopefully, this will help people setting up and using Jack for the first time.


First Post

August 11, 2009

OK this blog will most definitely be eclectic so let’s get down to business.


Follow

Get every new post delivered to your Inbox.