Friday, August 19, 2011

miniDLNA - access files from your PC!

I'm using miniDLNA to connect my Ubuntu PC with my Asus Transformer. Result is I get to play movies and music from my PC directly on my tablet!!


Here's how to setup miniDLNA on Ubuntu:


1) Get source file from here.
2) Extract and unpack the archive to a designated folder called "minidlna"
3) Edit file "minidlna.cnf" (config file in folder minidlna > etc )
4) From Terminal, go to the "minidlna" folder
5) Type the following command:
     username@machine:~/minidlna$ usr/sbin/minidlna -f etc/minidlna.conf
     *This needs to be typed in everytime you start the PC


Wednesday, June 22, 2011

Ubuntu: dd Command

Note: To test this out sometime later
dd if=<source> of=<target>


Duplicate sda2 into sdb2 

dd if=/dev/sda2 of=/dev/sdb2 bs=4096 conv=notrunc,noerror

Fixing old hard drive:
Code:
dd if=/dev/sda of=/dev/sda

Ubuntu: Navigating folders and directory commands in Terminal

Initial line in Terminal. Note that ~ represents the Home Folder.
username@machinename:~

To know your current working directory:

username@machinename:~$ pwd
home/rootfolder 


To know the list of items inside the path (or can also use command dir):
username@machinename:~$ ls
Folder1  Folder2  Folder3

To change directory:
username@machinename:~$ cd Folder1 
username@machinename:~/Folder1$
To return back to Home Folder:

username@machinename:~/Folder1$ cd ~ 
username@machinename:~$


To go to root filesystem:
username@machinename:~$ cd /
username@machinename:/$ ls 
bin    dev   initrd.img  media  root     srv  usr
boot   etc   lib         mnt    sbin     sys  var
cdrom  home  lost+found  proc   selinux  tmp  vmlinuz

To go up one level (notice there is a space, unlike in DOS where it is "cd.."):
username@machinename:/media$ cd ..
username@machinename:/$


To go up one level and to a specific folder name in that directory:

username@machinename:/media$ cd ../boot
 username@machinename:/boot$

Friday, April 8, 2011

Ubuntu: The following packages have been kept back

 To force update on packages that have been "kept back":


sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Tuesday, March 29, 2011

Ubuntu: Remove old kernel

Removing old kernel is part of system maintenance. Basically to clear up the boot space and tidy up the grub menu. Steps as below:

  • In terminal, type: uname -r. Take note of the kernel version
  • Go to System > Administration > Synaptic Package Manager
  • Search for linux-image
  • Select the older version kernel (which is not equal to first step above) with green box, right-click and select Mark for Removal
  • Click on Apply

Sunday, March 27, 2011

Ubuntu: Update grub manually

Here's how to update grub manually. In Terminal, type command: sudo update-grub


username@desktop:~$ sudo update-grub
[sudo] password for username: 
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-28-generic-pae
Found initrd image: /boot/initrd.img-2.6.35-28-generic-pae
Found linux image: /boot/vmlinuz-2.6.35-24-generic-pae
Found initrd image: /boot/initrd.img-2.6.35-24-generic-pae
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 10.10 (10.10) on /dev/sdb7
done
username@desktop:~$ 

Saturday, March 26, 2011

Ubuntu: Write access to files and folders in Live CD session

Usually we'll access the system via Live CD in scenarios where we cannot boot the system normally. So this is where you do troubleshooting, revise config files etc or to backup important data.


You will not have write access to some of these files and folders. To do so, open up terminal and type in the following command:


sudo nautilus


A new folder will open, and you will see this folder is set as root. You now have write access to all files and folders in the Live CD session.

Ubuntu: Regular cleanup maintenance

After each installation of updates etc. do the following steps for maintenance:


1) Launch terminal by going to Applications > Accessories > Terminal
2) Below are the 2 commands:
  • sudo apt-get autoclean
  • sudo apt-get autoremove

3) Since you're using sudo, enter sudo password. Depending if there are anything to be cleaned/removed, you will need to confirm by pressing y/n.


username@desktop:~$ sudo apt-get autoclean
[sudo] password for username:
Reading package lists... Done
Building dependency tree    
Reading state information... Done
username@desktop:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree    
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-2.6.35-22
0 upgraded, 0 newly installed, 1 to remove and 284 not upgraded.
After this operation, 80.1MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 133710 files and directories currently installed.)
Removing linux-headers-2.6.35-22 ...
username@desktop:~$

So, 80.1 MB of free space is now available! 

Ubuntu: Web browser cache folder

For those who are unfamiliar, cache folders are being used to store files, images etc as you browse websites on the Internet. So, you might be wondering what's so important to know the cache folder for? Well, all I can say is see it for yourself :D.


Here's the cache path in Ubuntu for the 2 web browsers below:


Mozilla Firefox:
/home/yourusername/.mozilla/firefox/xxxxxxxx.default


Google Chromium: 
/home/yourusername/.cache/chromium/Default




Ubuntu: Transmission settings backup in a fresh install

When you do a fresh install of Ubuntu, here's how to "export" Transmission's previous settings and torrent queues to the newly installed system:


1) In old system, go to /home/username/.config/transmission


  • Copy the contents of folders resume and torrent
  • File settings.json will have your settings, just make sure the download folder etc are revised (because your previous system might have different path folder etc.)


screenshot of the transmission's config folders

2) In the new system, go to the same folder above: /home/username/.config/transmission

  • Paste the items copied above according to their folders into here.


3) Run Transmission again, you should see all the queues and progress as per the previous system. Enjoy!

*Tips: ".config" is a hidden folder. You'll need to press Ctrl+H to view it.