Wednesday, September 28, 2011

Read a file in Python

Hi, I'll teach you how to read a file in Python

Python is a hight level programming language, very powerful and clean syntax.
file = open("C:/myfile.txt",'r') # open myfile in read mode
mylist= ["Words"] # create a list
while True:
      myline = file.readline()
      mylist.append(myline) # add a new node
      if not myline: break # end of file
for elemento in myList:
      print elemento

print "Created By:  Christopher Jimenez"

video editing ubuntu terminal

To install en Debian and derivatives: sudo aptitude install ffmpeg mencoder lame


    * Convert FLV to AVI: ffmpeg -i myvideo.flv myvideo.avi
    * Convert AVI to FLV: ffmpeg -i myvideo.avi myvideo.flv
    * Convert WMV to MPEG-4 (Xvid): mencoder myvideo.wmv -ovc xvid -oac mp3lame -o myvideo.avi

Many options are available in ffmpeg and mencoder to choose codecs(MPEG1/2, DivX, Xvid, MP3, AAC, QuickTime, H.264, Matroska...) and use this codecs(compression, profiles, etc. ..)

For help type this:
    * ffmpeg -formats
    * mencoder -ovc help

Sunday, September 18, 2011

Reconfiguring the screen in Ubuntu

 well, I'll quote the steps to configure the screen in Ubuntu
First we need to use this command:

sudo dpkg-reconfigure xserver-xorg

Then, we need to  edit this file to create the configuration

sudo gedit /etc/X11/xorg.conf

when you open the text file section replacement monitor to the bottom of everything with this text

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 30-71
VertRefresh 50-65

Section "Screen"
Identifier "Screen0"
Device "Configured Video Device"
Monitor "generic Monitor"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768" #Here you can use other size

Monday, September 12, 2011

Uninstalling Oracle on Ubuntu

Hi folks, again I passing on valuable information
We all know that Oracle is an excellent product and so on but do not always want on your machine for various reasons ... To uninstall Oracle on Windows simply use the Wizard and go problem solved. But we must put him in Ubuntu more labor, but because many things can go wrong, and if they want to know what things they invited him to try it for yourself.

Finally, the procedure to uninstall Oracle Linux on your machine is:

  1. $ su -
  2. $ dpkg -P oracle-xe-universal
  3. $ rm -rf /usr/lib/oracle/
  4. $ rm /etc/oratab
  5. $ rm /etc/init.d/oracle-xe
  6. $ rm -rf /usr/share/doc/oracle_xe
Success! We already have Oracle uninstalled.

Pd 1: Do not remember if we have to restart or not, but we lose nothing by doing so entering the following command sudo reboot

Pd 2: The $ sign means that we are working on the console

Ubuntu automatic shutdown script

Hi, this entry will pass a script that has a menu with functions such as turning off the computer at a time or in a given period or reboot.
I always use it. So I share with you.
Nothing else should create a. Sh and assign permissions to run simply by typing in the terminal the following command chmod a+x <fichero>.sh

sudo su!/bin/sh
echo ” ****Welcome to automatic shutdown script****”
echo “”
echo “”
echo ” MENU”
echo ” 1.-Shutdown PC NOW”
echo ” 2.-Reboot PC NOW”
echo ” 3.-Shutdown PC at a set time
echo ” 4.-Shutdown PC in a given period
echo ” 5.-Exit”
echo “”

echo -p “Select an option: ”; read OPTION
case $OPTION in
1) sudo halt;;
2) sudo reboot;;
3) echo -n ” Enter the time off:
read hour
sudo shutdown -h $hour;;
4)echo -n ” Enter the number of minutes, after which the PC is turned off:
read minutes
sudo shutdown -h $minutes;;
5) exit;;
exit 1;;
exit 0


Hello Earthlings, the goal of this blog is to create a knowledge base with what you learn in the great world of computing.

Anyway, I welcome you and hope we share valuable information!