In ubuntu there is a directory which contains all the information of the hardware of the running system,which is /proc.
Given below are important and frequently used files you can find inside /proc directory.
/proc/cpuinfo – this file contains information about CPU such as vendor_id,cpu family,model
,model name,cpu MHz,cache size etc.
/proc/meminfo – this file contains information about memory such as MemTotal, MemFree, BuffersCached,SwapCached,Active,Inactive etc.
/proc/loadvg – this file contains cpu load average information in last 1,5,15 minutes respectively.
/proc/partitions – this file contains partition related information.
/proc/version – this file contains linux version and gcc version of the system.
This blog was opened by a team who love foss and is open for all those who love to contribute for foss development. All the foss lovers are most welcome to our blog. Take from it.Do not forget to contribute!
Wednesday, December 14, 2011
How to send an email using a python script
Hi all,
If you want to send a mail you have to follow several steps including the following.
open up the web browser.
login into your account.
click on compose mail.
compose the message specify receiver and send the mail.
But if you can send a mail through a script it will save time for you.
Here is a python code for send a mail.
import smtplib
sender= 'senders_name@gmail.com'
receiver = 'receivers_name@gmail.com'
subject='Python is a powerful scripting language'
text = 'This is an auto generated email using python!!!'
# Credentials (if needed)
username = 'senders_name'
password = 'password'
msg = """\
From: %s
To: %s
Subject: %s
%s
""" % (sender, receiver, subject, text)
# The actual mail send
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(sender, receiver, msg)
server.quit()
if the file name is mail.py
run this command in terminal by typing
>>python mail.py
If you want to send a mail you have to follow several steps including the following.
open up the web browser.
login into your account.
click on compose mail.
compose the message specify receiver and send the mail.
But if you can send a mail through a script it will save time for you.
Here is a python code for send a mail.
import smtplib
sender= 'senders_name@gmail.com'
receiver = 'receivers_name@gmail.com'
subject='Python is a powerful scripting language'
text = 'This is an auto generated email using python!!!'
# Credentials (if needed)
username = 'senders_name'
password = 'password'
msg = """\
From: %s
To: %s
Subject: %s
%s
""" % (sender, receiver, subject, text)
# The actual mail send
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(sender, receiver, msg)
server.quit()
if the file name is mail.py
run this command in terminal by typing
>>python mail.py
Monday, December 12, 2011
How to access and see web contents without a browser
Hi all,
Have you ever seen contents of web pages without a web browser? There is a method in ubuntu to read web pages in terminal.This is really easy and it is a matter of installing just a one package.
sudo apt-cache search elinks
elinks - advanced text-mode WWW browser
sudo apt-get install elinks
to visit google :
>>elinks www.google.com
Have you ever seen contents of web pages without a web browser? There is a method in ubuntu to read web pages in terminal.This is really easy and it is a matter of installing just a one package.
sudo apt-cache search elinks
elinks - advanced text-mode WWW browser
sudo apt-get install elinks
to visit google :
>>elinks www.google.com
Saturday, November 19, 2011
Lenovo Laptops with Ubuntu 11.04
Me and my team encountered with this problem when we are testing our OS on laptops. We installed it to various laptops and this Lenovo laptops make us a big headache. Because Ubuntu has many hardware compatibility problems, most of the Lenovo laptops are not supporting to this compatibilities.
We find few issues when installing and running Ubuntu on Lenovo laptops.
1.System boots to garbled display
Refer this link and you can find the solution.
https://bugs.launchpad.net/ubuntu/natty/+source/grub-gfxpayload-lists/+bug/777212
2.Splash screen is not working properly when booting up.
This isn't solved yet. The problem is Lenovo is not picking up the correct resolution when the machine boots up and it directly calls to the text splash screen as my knowledge. when machine boots it will pick the resolution correctly and it outputs the correct splash screen. Suppose to give the solved answer when we fixed this issue.
3.Lenevo L412 slow to restart and shutdown .
This is another problem that occur when we testing the os on Lenovo L412. It took more and more time to restart and shutdown. We tried to find the reason few days and we couldn't at last we found it is a problem with the third party software called Likewise that we use join the machines to the domain. There were some processes that wouldn't kill when its shutting down. So the shutting down is waiting until this process kills. Our project manager Chamindra de Silva helped us to fix this issue.
1. Observe what is the process take more time to kill.
Press ALT + CTRL + F1 on the shutting-down splash screen then it will show what are the processes are killing. For me it was Likewise. There was a process that runs with likewise that took more time to kill. So what we do was go to the likewise source where /opt/likewise. Then went through the code and force to kill all all processes rather than hanging.
We find few issues when installing and running Ubuntu on Lenovo laptops.
1.System boots to garbled display
Refer this link and you can find the solution.
https://bugs.launchpad.net/ubuntu/natty/+source/grub-gfxpayload-lists/+bug/777212
2.Splash screen is not working properly when booting up.
This isn't solved yet. The problem is Lenovo is not picking up the correct resolution when the machine boots up and it directly calls to the text splash screen as my knowledge. when machine boots it will pick the resolution correctly and it outputs the correct splash screen. Suppose to give the solved answer when we fixed this issue.
3.Lenevo L412 slow to restart and shutdown .
This is another problem that occur when we testing the os on Lenovo L412. It took more and more time to restart and shutdown. We tried to find the reason few days and we couldn't at last we found it is a problem with the third party software called Likewise that we use join the machines to the domain. There were some processes that wouldn't kill when its shutting down. So the shutting down is waiting until this process kills. Our project manager Chamindra de Silva helped us to fix this issue.
1. Observe what is the process take more time to kill.
Press ALT + CTRL + F1 on the shutting-down splash screen then it will show what are the processes are killing. For me it was Likewise. There was a process that runs with likewise that took more time to kill. So what we do was go to the likewise source where /opt/likewise. Then went through the code and force to kill all all processes rather than hanging.
Wednesday, November 2, 2011
Basic customizations in ubuntu 11.04 using bash
How to change the wallpaper:
in terminal type
gconftool-2 --type string --set /desktop/gnome/background/picture_filename "path/to/wallpaper"
How to change the login window icon:
in terminal type
sudo cp path/to/icon /usr/share/icons/LoginIcons/apps/64/
create desktop shortcuts:
in terminal type the follwing 2 commands.
cp /usr/share/applications/any_file.desktop ~/Desktop
chmod +x ~/Desktop/any_file.desktop
If you have screenlets installed how to run sreenlets in terminal.
type the following command.
ex:run calculator screenlet:
python /usr/share/screenlets/screenlets-pack-basic/Calc/CalcScreenlet.py
change start menu icon:
in terminal type:
gconftool-2 --type string --set /apps/panel/objects/object_0/custom_icon "path/to/icon"
gconftool-2 --type bool --set /apps/panel/objects/object_0/use_custom_icon "true"
in terminal type
gconftool-2 --type string --set /desktop/gnome/background/picture_filename "path/to/wallpaper"
How to change the login window icon:
in terminal type
sudo cp path/to/icon /usr/share/icons/LoginIcons/apps/64/
create desktop shortcuts:
in terminal type the follwing 2 commands.
cp /usr/share/applications/any_file.desktop ~/Desktop
chmod +x ~/Desktop/any_file.desktop
If you have screenlets installed how to run sreenlets in terminal.
type the following command.
ex:run calculator screenlet:
python /usr/share/screenlets/screenlets-pack-basic/Calc/CalcScreenlet.py
change start menu icon:
in terminal type:
gconftool-2 --type string --set /apps/panel/objects/object_0/custom_icon "path/to/icon"
gconftool-2 --type bool --set /apps/panel/objects/object_0/use_custom_icon "true"
Menu editing in ubuntu 11.04
I assume you know that you can edit menus by right clicking main menu bar.You can edit your menu system as you want using that way very easily.But do you know that where these configurations are saved in your machine. Knowing these locations are really helpful when you want edit the menu system by script or if you want to make the exact menu system in another machine.
So here are the locations you should know.
applications.menu file location: ~/.config/menus/
.directory files location: ~/.local/share/desktop-directories/
.desktop files location: ~/.local/share/applications/
if you want to create the same menu system in another machine it is a matter of copying all those files into relevant locations of that machine.
Also remember to execute the following comamnd after file copying.
sudo killall gnome-panel
So here are the locations you should know.
applications.menu file location: ~/.config/menus/
.directory files location: ~/.local/share/desktop-directories/
.desktop files location: ~/.local/share/applications/
if you want to create the same menu system in another machine it is a matter of copying all those files into relevant locations of that machine.
Also remember to execute the following comamnd after file copying.
sudo killall gnome-panel
How to set visible your domain account in login window ubuntu 11.04
THIS IS APPLICABLE TO UBUNTU 11.04
Normally when you are in a network you can log into basically 2 types of accounts which are local accounts and domain accounts. If you want to log into your domain account you have to click the 'other' category in the login window and enter your username.But this may be a bit annoying and there is a way to set visible your domain account name in your login window and even hide any local accounts.
This is the way.
step 1:
log in to your domain account.Find the uid of you by typing id command in terminal.
example:
>id
uid=123456789(DOMAIN\username) gid=0(root) groups=0(root)
Here the UID is 123456789.
step 2:
add the following line to /etc/passwd file.repalce UID with the number you have found in the previous step.
DOMAIN\username:x:UID:0:Name_To_Be_Shown,,,:/home/local/DOMAIN/username:/bin/bash
step 3:(optional)
Hide local accounts from the login window.
edit /etc/gdm/custom.conf as follows.
[daemon]
TimedLoginEnable=false
AutomaticLoginEnable=false
TimedLogin=user
AutomaticLogin=user
TimedLoginDelay=30
DefaultSession=gnome-2d
[greeter]
#IncludeAll=false
Exclude=ALL THE LOCAL ACCOUNT NAMES WHICH SHOULD BE HIDDEN SEPARETED BY COMMAS.
Log out from the current session and see your domain account appearing in the login window.ENJOY!!!
Normally when you are in a network you can log into basically 2 types of accounts which are local accounts and domain accounts. If you want to log into your domain account you have to click the 'other' category in the login window and enter your username.But this may be a bit annoying and there is a way to set visible your domain account name in your login window and even hide any local accounts.
This is the way.
step 1:
log in to your domain account.Find the uid of you by typing id command in terminal.
example:
>id
uid=123456789(DOMAIN\username) gid=0(root) groups=0(root)
Here the UID is 123456789.
step 2:
add the following line to /etc/passwd file.repalce UID with the number you have found in the previous step.
DOMAIN\username:x:UID:0:Name_To_Be_Shown,,,:/home/local/DOMAIN/username:/bin/bash
step 3:(optional)
Hide local accounts from the login window.
edit /etc/gdm/custom.conf as follows.
[daemon]
TimedLoginEnable=false
AutomaticLoginEnable=false
TimedLogin=user
AutomaticLogin=user
TimedLoginDelay=30
DefaultSession=gnome-2d
[greeter]
#IncludeAll=false
Exclude=ALL THE LOCAL ACCOUNT NAMES WHICH SHOULD BE HIDDEN SEPARETED BY COMMAS.
Log out from the current session and see your domain account appearing in the login window.ENJOY!!!
Subscribe to:
Posts (Atom)