Thursday, May 28, 2020

Install Brother Printer DCP-T500W Driver on Manjaro Linux

Tried On:
Manjaro KDE 20 [official edition]
Kernel 5.6
Brother Printer DCP-T500W

Dependencies:
lib32-glibc [3]

Brother Printer Driver build from rpm is already on AUR package > brother-dcpt500w 3.0.2-1, you can install it directly if you want. But here, we are going to try how to install it manually from deb driver. In Linux, for printing you need cups and LPR. We will build each package for cupswrapper and LPR.
  • Make a PKGBUILD for CUPS wrapper from DEB [4]


  • Make a PKGBUILD for LPR from DEB [4]


  • Save each PKGBUILD in suitable package/folder

We arrange the files like this.
deb and pkg.tar.xz files will be created after next step.

  • build package

makepkg --printsrcinfo > .SRCINFO
makepkg -Acs
  • install package

sudo pacman -U brother-dcpt500w-cups-bin.pkg.tar.xz
sudo pacman -U brother-dcpt500w-lpr-bin.pkg.tar.xz
  • Run the shell script from installed driver

cd /opt/brother/Printers/dcpt500w/cupswrapper
sudo ./cupswrapperdcpt500w

Now the driver should be ready. We can add our printer [1] and print a test page.


Next:
how to install brother scanner


Friday, February 3, 2017

Tips for choosing the right 4G smartphone

4G is different than 3G. It's claimed to be faster but also consume more power. And one more concern is phone device and carier compatibility. 4G has two different kind of mobile data transmission technologies: 1] FDD (frequency division duplexing) and 2] TDD (time-division duplexing). FDD-LTE has balanced bandwidth for upload and download while TDD-LTE has more bandwidth for download.
While most 4G enable phone support FDD, only some of them support TDD and FDD. Some vendor limit the TDD band feature to regional edition and not the worldwide edition.
I think this frequencycheck quite useful to check this compatibility. You can use this as a reference before buying new 4G phone for your 4G carier.
Here's some example for carier frequencies in Indonesia














Make sure the 4G band is compatible with your choosen smartphone before buying.

Thursday, March 3, 2016

Securing Account PostgreSQL

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

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


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


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

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)