Just a note

Thursday, March 3, 2016

Securing Account PostgreSQL

2:15 PM Posted by wardah kaddihani No comments

using pgcrypto

The pgcrypto module provides cryptographic functions for PostgreSQL.[2]

  1. enter postgreSQL via terminal
    # psql 
  2. enter the database
    # \c database_name;
  3. create extension[1]
    # CREATE EXTENSION pgcrypto; 
  4. save the crypted password
    # INSERT INTO table_name(password_column, ...) VALUES(crypt('new password', gen_salt('md5')), ...)
    for new entries or for updating
    # UPDATE ... SET password_column = crypt('new password', gen_salt('md5')); 
    * md5 can be substitute by other algorithm as state in reference[2]
  5. example to match encrypted password
    # SELECT (password_column = crypt('entered password', password_column)) AS pswmatch FROM ... ;
    * return pswmatch as boolean

 

reference:

[1] http://www.postgresql.org/docs/current/static/contrib.html
[2] http://www.postgresql.org/docs/9.5/static/pgcrypto.html

Saturday, October 11, 2014

Install NVIDIA driver on LMDE

5:03 AM Posted by wardah kaddihani , , , , , , No comments
nvidia-settings front end

Installing proprietary driver actually a risky act. But it's worth trying for you who are brave enough to face a broken Xscreen for more 3D support. Don't worry you're not alone, I also face it a lot. Ready? Just remember, the risk is all yours :)

Done on:

- LMDE MATE 64 bit
- NVIDIA GeForce 310M 512MB (single no optimus)

Steps:

1. Detect NVIDIA card and the appropriate driver package
enter su mode
# sudo  su
install nvidia-detect package via apt or aptitude
# aptitude install nvidia-detect
run nvidia-detect
# nvidia-detect
we use detected NVIDIA GPU to look which driver version supports it. you can check it here
the newest version is 319.82 while the last stable version is 304.117

2. adding the installation repository

edit the /etc/apt/sources.list via pluma or nano or any text editor you have
pluma /etc/apt/sources.list
for newer version of driver add the wheezy-backport repository
# wheezy-backports
deb http://http.debian.net/debian/ wheezy-backports main contrib non-free
 
for stable (older) version of driver add the contrib and non-free repository
# Debian 7 "Wheezy"
deb http://http.debian.net/debian/ wheezy main contrib non-free

don't forget to update package list
# aptitude update

3. into the tty screen

enter tty1 by clicking Ctrl+Alt+F1 (or any other tty from tty1 to tty6)
login and enter su
# sudo su
it's better to turn off your desktop manager, mdm in my case. no more GUI this time
# /sbin/service mdm stop
install the appropriate linux header
# aptitude install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
install the recomended package by nvidia-detect
        for newer version
# aptitude -t wheezy-backports -r install nvidia-driver
        for older (stable) version
# aptitude -r install nvidia-driver 
* the nvidia-kernel-dkms package will be installed as well, if it isn't you can install it after this

you may install nvidia-setting and nvidia-xconfig as well
# aptitude install nvidia-setting nvidia-xconfig
after all this installation thing done you can run nvidia-xconfig. this will create a new X11 configuration file.
# nvidia-xconfig

4. brace your self. face the reality >:)

okay, take a deep breath and reboot your LMDE
# reboot
wait for all the booting process...
looking at the linux mint logo which is not as crisp as usual you maybe say
Oh, No!
okay, wait for a while...
if the NVIDIA logo comes up next then you have a successful installation. Congratulation! 

5. Oops...

when it didn't go well you can remove nvidia driver package and also remove the xorg.conf created by nvidia. take a look at reference [2] or [3]

Reference:

[1] wiki.debian.org
[2] lists.debian.org
[3] linux debian user groups

Thursday, March 20, 2014

Wordpress installation Linux Mint

4:17 PM Posted by wardah kaddihani , , , No comments

Pre-requisite
  • apache
  • mySQL
  • phpmyadmin
  • ftp
  • wordpress [download]

Wordpress Installation
1. unzip wordpress-x.y.zip
2. put it in your directory with write permission for other user

   sudo find . -type d -exec chmod 755 {} \;
   sudo find . -type f -exec chmod 644 {} \;


3. make a link to it in your http root directory /var/www or elsewhere

   sudo ln -s /full/path/to/wp_dir/ /var/www/wp_site
   
4. launch phpmyadmin in your browser
5. create new database for wordpress and a user account for it
6. launch localhost/wp_site in your browser
7. set up a configuration file just follow the steps
8. change write permission for wp-config.php

   sudo chmod 600 wp-config.php



Uploading Plugins and Themes
1. install new theme in appearance > theme > install theme > upload [the theme]
2. install plugin in plugin > add new > upload [the framework]
3. uploading Plugins and Themes require your user and password.
4. change wp-content write permission if you experience uploading failure and write permission error

   sudo chmod -R 747 wp-content/


References
[1] codex.wordpress

Monday, May 13, 2013

Dual Boot Linux Mint + Windows 7

8:19 PM Posted by wardah kaddihani , , , , , 1 comment

Case :: linux mint installed peacefully but something urgent makes you need to install windows 7 later

Prerequisite:
  • linux mint distro dvd 
  • windows 7 installation dvd
  • make sure your hard disk primary partition only takes at most 3 partitions
        notes:
  • msdos partition table only support 4 primary partition. so save 1 primary partition for windows
  • what if i used all the primary partition? okay, prepare yourself to loss one of the partition. next line will be an obligation
  • backup your data
        backup your home, backup your package using aptoncd, just in case there is a disaster

Steps
1. make more space for windows (resize partition)
  • insert linux mint dvd to tray, boot from DVD and open GParted
  • choose one partition that is large enough for your windows NTFS (at least 15 GB)
  • next we will resize it
 
        notes:
  • for safety measure resize the partition from the end (the white area). the beginning part may contain your data (the yellow area)
2. installing windows
  • insert windows dvd to tray, boot from DVD and install windows
  • choose the unallocated space
 
  • install & wait until it's finished 
  • now you will automatically boot to windows and your grub gone somewhere. 
3. reclaim the boot flag
  • reboot, insert linux mint dvd to tray again and open GParted
      
as you can see windows will grab the boot flag so we have to give it back to grub. we'll continue to the next step
    
4. reinstall & update grub


     now it's time to call the terminal
  • mount the linux mint partition
      $ sudo mount /dev/sda6 /mnt
  • mount some directories that are needed
      $ sudo mount --bind /dev /mnt/dev
      $ sudo mount --bind /sys /mnt/sys
      $ sudo mount --bind /proc /mnt/proc
  • mount boot partition (only if it's located in separate partition)
      $ sudo mount /dev/sda1 /mnt/boot
  • chroot to mount point
      $ sudo chroot /mnt
  • install grub to hard disk (not the partition)
      $ sudo grub-install /dev/sda
  • update grub to detect all bootable OS and option
      $ sudo update-grub
  • finishing... exit /mnt and unmount them
      $ exit
      $ sudo umount /mnt/dev
      $ sudo umount /mnt/sys
      $ sudo umount /mnt/proc
      $ sudo umount /mnt/boot
      $ sudo umount /mnt/

5. reboot again

      $ sudo reboot  

6. let's wait and pray...
    thank God it's back :D


tried this in detail (including screenshots) using virtualbox. hope it's not much different from the real thing

Reference:
update-grub from live-cd

Wednesday, October 3, 2012

Network Mode

12:45 PM Posted by wardah kaddihani No comments
Here's some useful setting to optimize your mobile connection using Galaxy Y.
We'll find a Network Mode option at Settings->Wireless & Network setting->Mobile Network settingturn off packet data first to change this setting.
what effect it does to you?

GSM only
this will limited your connection to G(GPRS) or E(EDGE) only. 
save more battery but slower connection

W-CDMA only
this will force your connection to 3G or H(HSDPA) only. 
drain more battery power but faster connection

GSM/W-CDMA (auto)
this will search for the best connection available. it could be G/E/3G/H (but mostly E for me)


Monday, May 21, 2012

Change my Font

7:19 AM Posted by wardah kaddihani , No comments
Changing font on Galaxy Y is super easy

1. put the font package on your SD card
  • you can manually download it over the internet. there a lot free flipfont package out there. 
  • using Fontomizer SP you can also download lots of free font package and see font preview before downloading it :D 
  • or maybe you want to try some fancy FlipFont in play store :)
2. install the font package you want
3. now go to settings  -> display -> screen display -> font style
4. choose any font you like
     note: 
     download button in this dialog link you to search "FlipFont" in play store
5. to apply it you have to restart phone
6. after restart you will see the result


Friday, March 30, 2012

Android custom sound Part II : Advance Volume Control

6:23 AM Posted by wardah kaddihani , No comments
Volume Control in Elixir. source: Google play
Android Gingerbread has volume control for ringtone, media, alarm, system volume, and notification. In older version of android we have fewer volume control. My previous galaxy 5 (2.1) has volume control for ringtone, media and notification only. Here we will control the rest sound volume using Elixir app. (or maybe you want to try Elixir 2)

Elixir support android 1.6 and up. Using this app we can control 7 sounds volume easily, such as:
1. Alarm
2. DTMF tones 
     -> sounds used for touch tone dialing
3. Music 
     -> also known as Media volume for music and games
4. Notification 
     -> for sms and other system notification
5. Phone Ring 
     -> for incoming call ring
6. System 
     -> other sound we don't know exactly :P
7. Voice Call 
     -> caller voice volume, which can only be adjusted when using phone call

How To Do it
1. just install the app
2. open it
3. scroll down -> sound, click the detail > and slide the volume bar as you wish