Get Last Accessed File Time In Ubuntu Linux

Get Last Accessed File Time In Ubuntu Linux

Ubuntu Linux has a rich set of commands for manipulating and accessing files. The stat utility gives detailed access to file information, including last accessed and last modified file time.

From the terminal window, run the command with this syntax:

stat filename

Here’s an example of checking the last time I’ve run Firefox on one of my machines:

# stat firefox-bin
File: `firefox-bin’
Size: 9781136 Blocks: 19136 IO Block: 4096 Regular
File
Device: 302h/770d Inode: 555615 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 500/ geek) Gid: ( 500/ geek)
Access: 2006-01-14 17:41:15.000000000 -0500
Modify: 2005-05-11 14:17:00.000000000 -0400
Change: 2005-05-13 23:31:44.000000000 -0400

Restore grub2 on Ubuntu 10.04

Restore grub2 on Ubuntu 10.04

1. Boot from live ubuntu CD
2. Open terminal and type :

sudo fdisk -l

3. Determine the HDD partition where Ubuntu was installed. Supposed it is sda7
Then type in terminal :

sudo mount /dev/sda7 /mnt

4. Restart the computer

5. Refresh the Grub2 menu with

sudo update-grub

Run ASP.NET Applications on Ubuntu

The ASP.NET development environment on Ubuntu is called XSP. This is a simple webserver written in C# that can be used for either ASP.NET 1.0 or 2.0 applications. You can install both environments side by side if need be.

ASP.NET 1.0

sudo apt-get install mono-xsp mono-xsp-base

sudo apt-get install asp.net-examples

This will install the development environment along with some sample applications. To run the sample applications, you need to launch the XSP process and point it at the samples. You can simply modify the path to run an application that you’ve created.

xsp –root /usr/share/asp.net-demos/

Listening on port: 8080 (non-secure)
Listening on address: 0.0.0.0
Root directory: /usr/share/asp.net-demos
Hit Return to stop the server.

ASP.NET 2.0

sudo apt-get install mono-xsp2 mono-xsp2-base

sudo apt-get install asp.net2-examples

This will install the development environment along with some sample applications. To run the sample applications, you need to launch the XSP process and point it at the samples. You can simply modify the path to run an application that you’ve created.

xsp2 –root /usr/share/asp.net2-demos/

Listening on port: 8080 (non-secure)
Listening on address: 0.0.0.0
Root directory: /usr/share/asp.net-demos
Hit Return to stop the server.

Type the following in the browser’s address bar to run ASP.NET application.

http://localhost:8080/

Eject & Load CDROM in Ubuntu from Terminal

To eject, type the following code in the terminal :-

eject cdrom

And to insert the tray back type the following code in the terminal :-

eject -t cdrom

Open Firefox Always in Online Mode in Ubuntu 8.04

In Ubuntu Hardy Heron, firefox always open in offline mode. This is really very annoying.To open firefox always in online mode do the followings :

1. Open firefox

2. In the address bar type the following and then press enter

about:config

3. In the filter bar paste the following :

toolkit.networkmanager.disable

4. Double click on it and make its value to “true”.

5. Restart firefox.

Now firefox will always open in online mode.

Mobile Broadband Bluetooth Dialup Networking in Ubuntu 8.04

Turn on bluetooth on your phone and Computer/Laptop.If you’ve already tried connecting them before, delete any reference to your bluetooth phone’s ID from your computer. To do this, type Alt+F2 and then type the following :

gksudo nautilus /var/lib/bluetooth/

( Enter password to give permission )

Now delete all files/folders there. Then turn off & then turn on computer’s bluetooth device. Then scan bluetooth device from your phone and add your computer as paired device.

( Enter the same pass code in both phone and computer. )

Now find the MAC address of your phone by typing the following command :

hcitool scan

Copy the MAC address. It looks like XX:XX:XX:XX:XX:XX

Now we need to find out what channel to connect to. For this type the following command :

sdptool browse XX:XX:XX:XX:XX:XX

( XX:XX:XX:XX:XX:XX <– This is your phone’s MAC address here )

In my case it looks like

siddhartha@ubuntu:~$ hcitool scan
Scanning …
00:19:2D:C1:D3:E1    Neo
siddhartha@ubuntu:~$ sdptool browse 00:19:2D:C1:D3:E1
Browsing 00:19:2D:C1:D3:E1 …
Service Name: Dial-up networking
Service RecHandle: 0x1018f
Service Class ID List:
“Dialup Networking” (0×1103)
“Generic Networking” (0×1201)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 1            <—– Find this channel number
Language Base Attr List:
code_ISO639: 0x656e
encoding:    0x6a
base_offset: 0×100
Profile Descriptor List:
“Dialup Networking” (0×1103)
Version: 0×0100

Service Name: Nokia PC Suite
Service RecHandle: 0×10190
Service Class ID List:
“Serial Port” (0×1101)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 15
Language Base Attr List:
code_ISO639: 0x656e
encoding:    0x6a
base_offset: 0×100

The Channel number for Dial-up Networking is pointed above. Now configure the bluez. Just type the following command in the terminal :

sudo gedit /etc/bluetooth/rfcomm.conf

Add the following text at the end :

rfcomm0 {
bind yes;
device XX:XX:XX:XX:XX:XX;          <—– Insert your phone’s MAC address here
channel 1;
comment “Mobile Dialup”;
}

Now restart bluetooth service by typing the following command :

sudo /etc/init.d/bluetooth restart

Then configuring PPP. Just run the following in terminal :

sudo gedit /etc/ppp/peers/BluetoothDialup

Now you see a blank text file. Then paste the following on the file

debug
noauth
connect “/usr/sbin/chat -v -f /etc/chatscripts/BluetoothDialup”
usepeerdns
/dev/rfcomm0 115200
defaultroute
crtscts
lcp-echo-failure 0

Save and close the BluetoothDialup file. Then run the following :

gksudo gedit /etc/chatscripts/BluetoothDialup

Now you see a blank text file. Then paste the following text on the text file, replacing your-apn and your-data-profile-number with the APN & data-profile-number from your data services provider. If you don’t know your apn (access point name) contact with your operator’s help line.

TIMEOUT 35
ECHO ON
ABORT ‘\nBUSY\r’
ABORT ‘\nERROR\r’
ABORT ‘\nNO ANSWER\r’
ABORT ‘\nNO CARRIER\r’
ABORT ‘\nNO DIALTONE\r’
ABORT ‘\nRINGING\r\n\r\nRINGING\r’
” \rAT
OK ‘AT+CGDCONT=1,”IP”,”your-apn-here”‘     <—– Insert access point name (APN)
OK ATD*99#    <—– Insert your-data-profile-number-here
CONNECT “”

Save and close the file.

To connect run the following command in terminal :

pon BluetoothDialup

To disconnect type the following command in terminal :

poff BluetoohDialup

Speedup Firefox

Type “about:config” into the address bar and hit enter. In the filter box, type the following
network.http.pipelining
Double click on it and make it “true”.
Then again, type the following in the filter box
network.http.proxy.pipelining
Again, double click on it and make it “true”.
Similarly type the following in filter box and set it to 20. This means it will be able to make 20 requests at a time.
network.http.pipelining.maxrequests
Now, right-click anywhere and select New-> Boolean
and name it
network.http.pipelining.firstrequest
and set it to “true”.
Normally the browser makes one request to a web page at a time. After enabling pipelining, it will make several request at once, which really speeds up page loading.
Lastly right-click anywhere and select New-> Integer. Name it
nglayout.initialpaint.delay
and set its value to “0″. This value is the amount of time the browser waits before it acts on information it receives. Also create another integer
content.notify.interval
and set its value “0″.
When you go to download multiple files you may notice that Firefox will only let you download two files at a time. If you want to download more you have to increase the number of connections Firefox can make. Type the following in the filter box
network.http.max-persistent-connections-per-server
and set its value to 8. Now you can able to download 8 files simultaneously.

Type “about:config” into the address bar and hit enter. In the filter box, type the following

network.http.pipelining

Double click on it and make it “true”.

Then again, type the following in the filter box

network.http.proxy.pipelining

Again, double click on it and make it “true”.

Similarly type the following in filter box and set it to 20. This means it will be able to make 20 requests at a time.

network.http.pipelining.maxrequests

Now, right-click anywhere and select New-> Boolean

and name it

network.http.pipelining.firstrequest

and set it to “true”.

Normally the browser makes one request to a web page at a time. After enabling pipelining, it will make several request at once, which really speeds up page loading.

Lastly right-click anywhere and select New-> Integer. Name it

nglayout.initialpaint.delay

and set its value to “0″. This value is the amount of time the browser waits before it acts on information it receives. Also create another integer

content.notify.interval

and set its value “0″.

When you go to download multiple files you may notice that Firefox will only let you download two files at a time. If you want to download more you have to increase the number of connections Firefox can make. Type the following in the filter box

network.http.max-persistent-connections-per-server

and set its value to 8. Now you can able to download 8 files simultaneously.

Follow

Get every new post delivered to your Inbox.