MySQL TIPS

If you have never set a root password for MySQL server, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:
$ mysqladmin -u root password NEWPASSWORD

However, if you want to change (or update) a root password, then you need to use the following command:
$ mysqladmin -u root -p'oldpassword' password newpass

For example, If the old password is abc, you can set the new password to 123456, enter:

$ mysqladmin -u root -p'abc' password '123456'

Change MySQL password for other users

To change a normal user password you need to type (let us assume you would like to change password for user vivek) the following command:
$ mysqladmin -u vivek -p oldpassword password newpass

Changing MySQL root user password using MySQL sql command

This is another method. MySQL stores username and passwords in user table inside MySQL database. You can directly update password using the following method to update or change password for user vivek:

1) Login to mysql server, type the following command at shell prompt:
$ mysql -u root -p

2) Use mysql database (type command at mysql> prompt):

mysql> use mysql;

3) Change password for user vivek, enter:

mysql> update user set password=PASSWORD("NEWPASSWORD") where User='vivek';

4) Finally, reload the privileges:

mysql> flush privileges;
mysql> quit
Advertisements

ArchLinux connecting to wireless through CLI [WPA]

# iwlist wlan0 scan
Cell 01 - Address: 04:25:10:6B:7F:9D
                    Channel:2
                    Frequency:2.417 GHz (Channel 2)
                    Quality=31/70  Signal level=-79 dBm  
                    Encryption key:off
                    ESSID:"dlink"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
  • If using WPA encryption:

Using WPA encryption requires that the key be encrypted and stored in a file, along with the ESSID, to be used later for connection via wpa_supplicant. Thus, a few extra steps are required:

For the purpose of simplifying and backup, rename the default wpa_supplicant.conf file:

# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original

Using wpa_passphrase, provide your wireless network name and WPA key to be encrypted and written to /etc/wpa_supplicant.conf.

The following example encrypts the key “my_secret_passkey” of the “linksys” wireless network, generates a new configuration file (/etc/wpa_supplicant.conf), and subsequently redirects the encrypted key, writing it to the file:

# wpa_passphrase linksys "my_secret_passkey" > /etc/wpa_supplicant.conf

Check WPA Supplicant for more information and troubleshooting.

Note: /etc/wpa_supplicant.conf is stored in plain text format. This is not risky in the installation environment, but when you reboot into your new system and reconfigure WPA, remember to change the permissions on /etc/wpa_supplicant.conf (e.g. chmod 0600 /etc/wpa_supplicant.conf to make it readable by root only).
  • Associate your wireless device with the access point you want to use. Depending on the encryption (none, WEP, or WPA), the procedure may differ. You need to know the name of the chosen wireless network (ESSID).
Encryption Command
No Encryption iwconfig wlan0 essid “linksys”
WEP w/ Hex Key iwconfig wlan0 essid “linksys” key “0241baf34c”
WEP w/ ASCII passphrase iwconfig wlan0 essid “linksys” key “s:pass1”
WPA wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
Note: The network connection process may be automated later by using the default Arch network daemon, netcfgwicd, or another network manager of your choice.
  • After utilizing the appropriate association method outlined above, wait a few moments and confirm you have successfully associated to the access point before continuing, e.g.:
# iwconfig wlan0

Output should indicate the wireless network is associated with the interface.

  • Request an IP address with /sbin/dhcpcd <interface>, e.g.:
# dhcpcd wlan0
  • Lastly, ensure you can route using /bin/ping:
# ping -c 3 www.google.com
PING www.l.google.com (74.125.224.146) 56(84) bytes of data.
64 bytes from 74.125.224.146: icmp_req=1 ttl=49 time=87.7 ms
64 bytes from 74.125.224.146: icmp_req=2 ttl=49 time=87.0 ms
64 bytes from 74.125.224.146: icmp_req=3 ttl=49 time=94.6 ms

--- www.l.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 87.052/89.812/94.634/3.430 ms

SOURCE: From the great ArchLinux wiki at https://wiki.archlinux.org/index.php/Beginners%27_Guide#Setup_wireless_in_the_live_environment_.28optional.29

Fedora 16 Release Name Voting

Vote for Fedora 16 Release Name

 

You can now vote for your favorite Fedora 16 Release name VOTE HERE

note:

To vote, you must have a valid Fedora Contributors License Agreement (CLA) and be a member of at least one non-CLA group

 

Giving KDE a 3 months try

I want to give KDE a try because I am learning about Qt since KDE is based on Qt it would be a great experience to start using it and try Qt applications, I am giving a 3 months try and see what happens, I am gnome user. If you have any tips or tricks would be awesome so let me know. At the end of this challenge I will update my blog and write about my experience with the KDE desktop environment and community.

Imagemagick is cool ! [How to use Imagemagick]

Design from the Command Line

Imagemagick is a tool for photo editing like GIMP or Adobe Photoshop, But it isn’t in a GUI mode like GIMP or Adobe Photoshop it is for the command line.  If you want to know more about this tool I suggest you to go to the Imagemagick.org

This is a very short tutorial that shows how powerful this tool can be.

Note: This tutorial is about GNU/Linux users didn’t try it on any windows machine.

Most of the modern GNU/Linux distrobution has Imagemagick pre-installed

When you insall the Imagemagick pack it comes with some cool tools, example the display tool it allows you to view pictures:

ardian@skullnet:~/Pictures$ display meditate-tiny.jpg

Now for some reason you want to Grayscale an image it is very simple.

ardian@skullnet:~/Pictures$ ls convert -colorspace Gray meditate-tiny.jpg output.png

ardian@skullnet:~/Pictures$ convert -bordercolor yellow -border 8 richard-stallman.jpg output.png

$ convert [input-options] input-file [output-options] output-file

These are just little things that you could do with Imagemagick if you want to know more options you can check man convert.

This shows that even without using a mouse you can design, you have only to know what you do. Imagemagick is useful when you want for example to make black and white all of your photos you could do that with a command or a bash script.

Free Software Parable

“Those laws affect my life. I’m going to find out what they’re doing in the

via Free Software Parable.

LibreOffice on Fedora

How to install Libreoffice on Fedora

Remove OpenOffice first.

1.  Get the pack from http://www.documentfoundation.org/download/

2.  Go to the dir where you saved the tar.gz file and extract it using this command tar -zxvf LibO_3.3.0_beta2_Linux_x86_install-rpm_en-US.tar.gz (The name of the file may change depends on which version you have)

3. After the extract, you may get a dir (folder) called “en-US” use the cd command to go in

4. cd en-US

5. cd RPMS

6. # rpm -i *.rpm (This will install all the rpms that are in) You have to run it as root

7. cd desktop-integration

8. # rpm -i libreoffice3.3-redhat-menus-3.3-1.noarch.rpm (This will install the LibreOffice menus)

NOTE ! If you have any problems opening LibreOffice from the menus you can still use this command

/opt/libreoffice3/program/soffice.bin

 

Getting Started with PyQt

Wikipedia:

PyQt is a Python binding of the cross-platform GUI toolkit Qt. It is one of the alternatives for GUI programming in Python to Tkinter, which is bundled with Python. Other popular alternatives are PyGTK and wxPython. Like Qt, PyQt is free software. PyQt is implemented as a Python plug-in.

I started reading some tutorials on Python GUI programming and saw the Qt freamwork, I have heard also about Qt in my past, So I found a way that I can use PyQt for my python programms. While watching some videos on YouTube I saw this software called qt4-designer. It looked so easy to use and very user friendly, It looked like Visual Basic (I used to do some small exercise in visual basic back in the time) So I thought to give it a try. The first idea that I had was to do a “yum install qt4-designer’  but I couldn’t find the software so I thought to get the code and build it from source. I asked the guys at irc.freenode.net #fedora-kde if they have used qt4-designer and for the good somone respond. He said that the software I am looking for is already in the repo. It was very simple “yum install qt-devel” would install everything needed. So I got everything up and running in minuts and that thanks to a big community like the FedoraProject.

Fedora 14 Beta – First Test

This is my first time trying Fedora 14

Running it with a live usb

For the first minuts Fedora 14 looks and feels stable, I didn’t check everything, things that I noticed were it comes with Python 2.7 and a new wallpaper.

[liveuser@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.35.4-28.fc14.i686 #1 SMP Wed Sep 15 02:03:44 UTC 2010 i686 i686 i386 GNU/Linux

Will wait for the final release and write a bigger post about it

Installing IPv6 on Fedora

Packs that need to be installed:

# yum install gcc-c++

#yum install openssl-devel.i686

#Maybe you need libssh-dev

wget http://go6.net/4105/file.asp?file_id=166
mv file.asp\?file_id\=166 test.tar
tar -xf test.tar
cd gw6c-6_0_1/
make                                                           g++ must be installed
make installdir=/home/username/test install
run as root # /home/username/test/bin/gw6c -f /home/username/test/bin/gw6c.conf

%d bloggers like this: