eXTReMe Tracker

slash_boot

Sep 162014
 

Every once in a while as you are trying to make a .iso file from a DVD using Brasero, you might get an error saying that couldn’t retrieve the keys because of libdvdscc2.

An alternative to that is a command line tool called dvdbackup which first needs to be installed

sudo apt-get install dvdbackup

After installing that program, you can make backup of your entire dvd, unfortunately not an .iso. You can create an iso from the folder that gets generated once you backup the dvd using dvdbackup. To create a backup, open your terminal and run:

 dvdbackup -M -i /path/to/dvd/  -n Title_For_Backup -o /path/to/output/directory

To get help of dvdbackup you simply have to type in dvdbackup at the terminal.

Sep 252013
 

Before making any modification to any files, first create a backup of smb.conf file

sudo cp /etc/samba/smb.conf  /etc/samba/smb.conf.bak

The open the configuration file for editing:

sudo gedit /etc/samba/smb.conf

In the section identified as Share Definitions, insert this piece of code. The path string should be the path for folder you will be sharing. If you want others to have the ability to write to that directory –

sudo mkdir -p /path/to/shared/folder
sudo chown nobody.nogroup /path/to/shared/folder
[share]
    comment = Ubuntu File Server Share
    path = /path/to/shared/folder
    browsable = yes
    guest ok = no
    read only = no
    create mask = 0755

Once the configuration file has been saved, its time to restart the samba daemon

sudo restart smbd
sudo restart nmbd

Once the samba daemon has restarted, you need to add a list of users who can access samba folder.

sudo smbpasswd -a username

To access this directory from windows, open My Computer -> Tools -> Map Network Drive

Folder address for this share would be:

\\ip_address_of_your_server\share

NOTE: The folder is called share in the share definition. You can call it something else and edit the parameters based on the chosen share name.If you want to have access to this folder each time, make sure to save the password and check that option to reconnect at login.

 

 

Aug 212013
 

If the gnome/mate/cinnamon session becomes unresponsive, you can use the Ctrl+Alt+F1 key sequence to get to shell mode. Once there,  you can login and run the following command to end the graphical session:

sudo pkill -KILL -u USER_NAME
Jan 112013
 

To get the stock quotes for NYSE listings create some file named stockval and add it to your PATH.

Then gedit the file with the text:

#!/bin/bash

p=`printf "curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=$1&f=l1'"`
price=`eval $p`;
echo $price

stock_quote_ticker

 

 

 

 

 

 

 

 

 

 

Make that file executable

chmod +x stockval

Close out, and open a terminal. If you have the path correctly configured, execute the stockval command using the company symbol as an argument and it returns the stock price on the line below.

stockval goog

732.15 << output
Nov 202012
 

When you start getting this error, the easiest way to get around it is to boot through a Live CD and create a root password.

sudo passwd root
su root

Once you are logged in as root, navigate to your partition that has system installation.

chown root:root usr/bin/sudo
chmod 4755 usr/bin/sudo
chmod 0440 etc/sudoers
chmod u+s usr/bin/sudo 

Oct 292012
 

As it turns out the if statement in bash isn’t as friendly towards floating point variables as it is for integer and string variables.

First of all the -gt and -lt switches don’t work.Even the unary operators >,<, etc. don’t work. The only way is to do a comparison between the floating point variables using bc and using the logical outout as a comparison string.

a=11.5; b=11.3
compare_result=`echo "$a >$b" | bc`
 if [ $compare_result -gt 0 ]; then
 echo $a
else
echo $b
 fi

 

Oct 242012
 

1. Convert the brain.mgz volume to analyze:

mri_convert $SUBJECTS_DIR/bert/mri/brain.mgz brain.img

2. Align brain.img with your functional data in spm (eg, func.img)

3. Create your spm statistical output (eg, t.img)

4. Create the registration file:

tkregister2 --s subjectname --mov meanswaf.img --regheader --reg  register.dat --surf orig

This will bring up the tkregister window with the orig volume. Hit the “Compare” button to see the functional. The green line will be the surface. Make sure the alignment is good (ie, the green line follows the bright intensity patterns in the functional). Hit the “Save” button to save the registration. This will create a file called register.dat. If you make modifications to the registration and then want to view or edit it later, re-run the above command WITHOUT –regheader. This requires a lot of manual tweaking to get the functional brain aligned with Bert brain.

5. View your functional data in the volume:

tkmedit subjectname orig.mgz -overlay spmT_0001.img -overlay-reg register.dat

6. View your functional data on the surface:

tksurfer subjectname lh inflated -overlay spmT_0001.img -overlay-reg register.dat

Adopted from spmPainting