Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, May 28, 2010

Effortless access to iPhone 3GS’ files without hacking in the new Ubuntu 10.04

Effortless access to iPhone 3GS’ files without hacking in the new Ubuntu 10.04.
Versions affected: At least iPhone OS 3.1.2, 3.1.3.

Ubuntu Lucid Lynx 10.04 can read your iPhone's secrets

Victor

Saturday, May 08, 2010

How to Backup & Restore the Configuration of your Ubuntu Panel

Useful trick posted by Ubuntu Genius: How to Backup & Restore the Configuration of your Ubuntu Panel

Saturday, December 13, 2008

Setting up NFS share on Ubuntu

This post summarizes steps I've done to setup a NFS share on Ubuntu 8.10 VM host and mount it on an another Linux machine (Debian Linux running on embedded arm in my case).

Host machine: Ubuntu, 192.168.1.110
Client machine: Debian, 192.168.1.175

1. Install NFS package by either going to Synaptic Package Manager (System->Administration->...) and searching for nfs-kernel-server or typing the following on the command line:
$ sudo apt-get install nfs-kernel-server

This will download and install all the required dependencies.

2. Add the directory desired to be shared, permissions and other information to /etc/exports file.
$ vi /etc/exports
Add without quotes: "/path/to/nfsshare 192.168.1.110/255.255.255.0(rw,no_root_squash,insecure)"

Here, 192.168.1.110 is the IP of the host. The mask allows NFS connections from the following IP addresses: 192.168.1.0-255. This can be modified to suit the needs.

3. Restart NFS and update the exports list.
$ sudo /etc/init.d/nfs-kernel-server restart
$ sudo exportfs -a

4. To mount NFS root, run on the client:
$ portmap &

5. Mount NFS shared directory on the client machine.
$ mkdir /mnt
$ mount -t nfs 192.168.1.110:/path/to/nfsshare /mnt

6. Now the files placed into /path/to/nfsshare/ on the host are accessible from the client!

Notes
1. Mounted devices can be found here:
$ cat /proc/mounts
or just run
$ mount

2. For automatic mounts after restart of the client, I added the following line to ~/.bashrc file:
mount -t nfs 192.168.1.110:/path/to/nfsshare /mnt

3. To check the IP addresses of the Linux machines, run 'ifconfig'.
To check the connection between the machines, use the ping command:
-from client: 'ping 192.168.1.110'
-from host: 'ping 192.168.1.175'

References:
[1] Enabling NFS in Ubuntu
[2] Easy-Peasy Ubuntu Linux NFS File Sharing

Adding a root user without root access (Ubuntu)

If you are trying to run a root command and your username is not in the sudo list (i.e. getting a message like " is not in sudoers file ubuntu" when running 'sudo '), then add yourself to the sudoers file.

1. Reboot the machine and enter the recovery mode (press ESC a few times during the startup and select Recovery Mode)
2. Execute 'visudo'. Copy the line containing 'root ...' from sudoers file replacing root with your username.
3. Save the file and root. Your username now should be allowed to run sudo command.

Password Reset in Linux (Ubuntu Recovery Mode)

Here is another password recovery post that I previously used for dual boot system with Grub:
http://cybercamping.blogspot.com/2007/04/easy-password-reset-in-linux-using-grub.html

This post explains how to reset a password using Ubuntu's Recovery Mode. I used it on my Ubuntu 8.10 VM running under Windows.
1. Boot the machine and hit ESC few times to skip hardware boot options, and go into the grub menu
2. Select a Recovery Mode option.
3. If a Recovery Menu window popped up, select "root Drop to root shell prompt"
4. Type 'passwd ', hit enter and select your password.

To see the list of user names on the machine, look in /home/ directory (ls /home). Also, one can check the passwd file (tail /etc/passwd).

Sunday, November 16, 2008

Installing Ubuntu in VMWare

Ubuntu version: 8.10
VMWare Workstation 6

Download Ubuntu from http://www.ubuntu.com/getubuntu/download/
Burn ISO image (i.e. using free open source InfraRecorder from http://infrarecorder.org/)
Install VMWare and create virtual machine (I allocated maximum of 10 Gb in 2 Gb chunks and allowed expansion on demand since I am not expecting high performance)
Power on the created VM and install Linux as usual
Install VMWare Tools on Windows by selecting it from VM menu
Install the Linux VMWare tool package. Refer to: http://www.howtogeek.com/howto/ubuntu/install-vmware-tools-on-ubuntu-edgy-eft/

Problems with network interface
Symptoms: no connection to internet. Ipconfig command does not exist, eth0 interface does not exist (System->Administration->Network Tools shows only loopback interface)

From Windows:
run ipconfig /all to see VM interfaces. For me one was a direct bridge and another one for NAT.

From Ubuntu:
Run ping www.ubuntu.com. This ping test replied for me, so it's not too bad
System-> Preferences->Network Connections: I tried adding wired connection and editing the IP, mask and gateway for interfaces from "ipconfig /all" run above.
I don't know whether this have helped, but after restart, eth0 interface appeared under wired connections. My VM was connected.

VMWare Player
After the VMWare's trial period ends, I will install the pre-packaged version of Ubuntu (VMWare Ubuntu Appliance), which can be run from the free VMWare player.
Ubuntu 8.10 from Sisoracle: http://www.visoracle.com/vm/ubuntu810/
Ubuntu 8.10 from Tuxdistro: http://www.tuxdistro.com/torrents-details.php?id=1339
VMWare Player: http://www.vmware.com/download/player/

File access between Windows and Linux
With VMWare Desktop and installed VMWare tools, copying text and files is as easy as drag and dropping. When using free VMWare Player, tools like Samba and WinSCP will be required. The following guide explains the whole installation process including tricks with VMWare Player, accessing Ubuntu's command line via Puttu from Windows and zipping the VM onto usb key. http://www.tanguay.info/web/tutorial.php?idCode=installUbuntuOnVmware

Installing CVS under Ubuntu 8.10

My experience installing CVS server on Ubuntu 8.10 Desktop
CVS version: 1.12.13
CVSD version: 1.0.15

Quick reference:

##########################################################################
# Installation
##########################################################################
# Install CVS
sudo apt-get install cvs

# Alternative install (RPM to DEB)
# Go to: ftp://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-linux/RPMS/i386/
# Download the latest RPM, save to ~/Desktop/
# Convert to DEB and install
# Summary of instructions from: http://ubuntu.wordpress.com/2005/09/23/installing-using-an-rpm-file/
#sudo apt-get update
#sudo apt-get install alien
#sudo alien -k name-of-rpm-file.rpm
#sudo dpkg -i name-of-deb-file.deb

# To remove CVS
#apt-get remove --purge cvsd

# Install CVS server
sudo apt-get install cvsd

##########################################################################
# Server Setup
##########################################################################
# Create root for repository
sudo cvsd-buildroot /usr/local/cvsroot/

# Create cvs group
groupadd cvs

# Give cvs group the ownership of the repository
sudo chown -R root:cvs /usr/local/cvsroot

# Set permissions so that the files created by the group remain
# in its ownership
# Note: until this command was run I could not execute the init
# due to permission problems
sudo chmod -R g+srw /usr/local/cvsroot/

# Initialize repository (creates empty repository in the root)
# /usr/local/cvsroot/CVSROOT/ admin folder will be created
cvs -d /usr/local/cvsroot init

# Add users to to cvs group.
# Note: to add user using gui, run sudo users-admin or
# access Users and Groups via System->Administration.
# Unclock the changes, modify the group and check desired users
sudo usermod -G cvs lomtik

##########################################################################
# Initial check in, check out, commit and release
# Eg project: ~/work/sample_project/ has file hello.c
##########################################################################
# Add CVSROOT environment variable
# In sh/bash, add the following lines to .profile/.bashrc:
CVSROOT=/usr/local/cvsroot
export CVSROOT
# In csh/tcl, add the following lines to .cshrc/.tcshrc:
#setenv CVSROOT /usr/local/cvsroot

# First check in
# Check in files from the current directory to sample_project folder
# with vendor lomtik and initialtag sample_proj_v_1_0
cd ~/work/sample_project/
# Note new directory: /usr/local/cvsroot/sample_project
cvs import -m "initial check in" sample_project lomtik sample_proj_v_1_0

# Move files from current directory to a temporary folderand check out
# their version from the repository
mv ~/work/sample_project/hello.c ~/work/temp/
cvs checkout sample_project

#
# Modify hello.c
#

# Commit/Check in the changes
cvs commit -m "Added changes to the file" hello.c

# Release the module
# After commit, the changes are synched with the vault. However,
# cvs does not lock the local files. Thus, either manually delete
# files or run release command to let cvs to check whether something
# has been changed since the last commit.
# Note: run from above dir
# Note: -d deletes the file
cd..
cvs release -d hello.c

##########################################################################
# Revisions
# http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_4.html#SEC44
##########################################################################

##########################################################################
# Notes
##########################################################################
# Repository directories relative to repository look can be found in:
# /etc/cvsd/cvsd.conf
# i.e. Repos /cvsrepo
# Repos /demo

# Things to look at:
# jCVS - GUI
# VC package for emacs

# CVS Space usage:
# 3 x single repository size or
# num_developers x single repository size

# Ideas:
# Setup VM with repository (can use pre-built images)
# Use free VM Player on any system for portability

# Rereferences:
# CVS Manual: http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_toc.html#SEC_Contents
# Quick Ubuntu, but incomplete: http://www.markcasimer.com/2006/06/12/InstallingCVSOnUbuntu.aspx
# Quick Ubuntu, missing details and group permission setup: http://sanatio.blogspot.com/2005/12/cvs-server-on-ubuntu.html
# Good guide, not for Ubuntu: http://rimuhosting.com/howto/cvs.jsp
# CVS RPMs: ftp://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-linux/RPMS/i386/
# Installing from RPM: http://ubuntu.wordpress.com/2005/09/23/installing-using-an-rpm-file/

Sunday, May 11, 2008

Partitioning tools

Keywords:
restore MBR
grub error 22
partition
tools

Restoring mbr: http://www.neowin.net/forum/lofiversion/index.php/t405091.html
1. Run fixmbr
2. Run fix boot

Free partitioning tools:
CloneZilla GParted LiveCD
Gparted LiveCD
Parted Magic
XP Recovery Console CD image
Partition Logic
Ranish Partition Manager
Cute Partition Manager

Shareware partitioning tools:
Paragon Partition Manager
Paragon Hard Disk Manager
Terabyte BootIt NG
Acronis Disk Director
V-Com (Avanquest) Partition Commander
EASEUS Partition Manager
7Tools Partition Manager
Spotmau Partition Genius

Wednesday, April 11, 2007

Easy password reset in Linux (using Grub)

Another passwd reset post: link

It's being almost a year since I've finished university. Back then I've had a dual boot system on my laptop, using Linux and Windows XP 50/50 percent of the time. Since then I went for a Eurotrip with my friends and moved to Vancouver exploring numerous local mountains and the beautiful land of BC and coastal US. It's been a good four to six months before I've decided to log back into my Linux partition only to find out that I forgot the password that I have changed during one of the last exam days, when I was pushing as much of academic stuff into my head as possible. The only thing that I forgot to do is to memorize the pass. I have tried all the possible combinations that I thought I remembered, but no luck. So, I let it go deciding to come back and recover it later, when I conquer Spanish classes and some training at work that I was busy with on my spare time.

Later in the previous sentence happened to be another four or so months. I've had enough of Linux at work and didn't feel like spending more precious time at home installing something not so user friendly and adapting it (i.e. building/compiling entertainment soft) for home entertainment. I like Linux, don't get me wrong, but it's still sometimes a pain in the butt when something does not work when you need it soon and you know you can do it much faster just by rebooting back to Windows.

In any case, recently I have registered for Wireless Communications course through online program at Stanford, and began spending much more time at my home's laptop than before for obvious reasons. A quick search in the newsgroups has revealed that changing Linux's password is a matter of a few minutes! Even the learning part was trivial, requiring just a few logical steps.

I have tested this on my Ubuntu distribution. From the links below, it looks as even a fewer steps are required for SuSE.

1. Reboot the computer
2. At Grub loader's menu, select the usual line you are using for starting Linux and hit 'e' to edit it.
3. In the appeared boot steps menu, edit the line that contains kernel reference, adding 'init=/bin/bash' to it.
4. Hit Enter to finish editing the line and 'b' to boot to Bash shell.
5. Now, assuming that you don't have RW access, type the following in Bash: 'mount / -o remount,rw'.
6. Use 'passwd' to change root's password, or 'passwd lomtik' to change password for user named lomtik.
7. You are good to go. Reboot and use the newly set passwords!

Now I can say: "Esto es muy fácil!" with a smile on my face : )

Tuesday, March 21, 2006

Ubuntu - Mounting Windows Partitions

Here is a nice guide how to mount NTFS and FAT32 partitions under Ubuntu: http://www.psychocats.net/linux/mountwindows.php

Ubuntu 5.10 - Cleaning up the space

Here are some some ideas how to clean up the space.
1) Run the following command:
sudo apt-get clean

2) Clean up synaptic's downloaded files

3) To estimate file space usage, change directory to root and use du command:
cd / sudo du -hc --max-depth=1
Here is example of what is printed for me:
48K ./lost+found
14G ./media
36M ./etc
76M ./var
90M ./lib
2.4G ./usr
4.0M ./bin
7.7M ./boot
2.9M ./dev
732M ./home
4.0K ./mnt
507M ./proc
23M ./root
8.4M ./sbin
72K ./tmp
0 ./sys
4.0K ./srv
4.6M ./opt
4.0K ./initrd
4.0K ./debootstrap
4.0K ./_F
1.4G ./_D
4.0K ./_C
37G ./_E
2.1G ./_sky7
12K ./Xilinx
58G .
58G total