April 26, 2015

Atom for 32bit Arch Linux (or other Linux 32bit distros)

Actually, there's a package in AUR (https://aur.archlinux.org/packages/atom-editor/) but I am too lazy to compile it myself, so here it goes.

Atom is available in binary releases for 64bit only for Linux. Luckily, WebUpd8 team provides binary packages for 64bit and 32bit Ubuntu. Get the package here: https://launchpad.net/~webupd8team/+archive/ubuntu/atom/+packages. For this article, I downloaded 32bit binary for Vivid. We will convert this file using deb2targz utility. You should get it first. If you are in Arch Linux, get from AUR (yaourt -S deb2targz), if you are not from Arch fame (:p) get it here: http://www.miketaylor.org.uk/tech/deb/deb2targz. The .deb file that was just downloaded:

-rw-r-----   1 bpdp bpdp 49547144 Apr 26 17:16 atom_0.194.0-1-webupd8-1_i386.deb

Put it somewhere wherever you like. Once you get deb2targz working, follow these steps:
  1. Convert .deb to tar.xz: $ deb2targz atom_0.194.0-1-webupd8-1_i386.deb
  2. Extract .xz file: $ tar -zvf atom_0.194.0-1-webupd8-1_i386.tar.xz. You will have two dirs: usr and opt. In opt dir, extract file atom/atom-linux32.tar.xz: $  tar -xvf atom-linux32.tar.xz.
  3. Put those two dirs inside whatever dir you like, mine is /home/bpdp/software/atom. We call this $ATOM_DIR (not necessarily exist, just for this article only).
  4. This .deb package search atom binary at /tmp/atom-build/atom, which is surely doesn't exist. To make it works, we should edit usr/bin/atom file. Find the line which says [ -x "$ATOM_PATH" ] || ATOM_PATH="/tmp/atom-build/atom" and change it to [ -x "$ATOM_PATH" ] || ATOM_PATH="/home/bpdp/software/atom/opt/atom/atom" (well of course you should put your own location of atom binary (mine is /home/bpdp/software/atom/opt/atom/atom).
  5. Now you should be able to run atom from $ATOM_DIR/usr/bin: $ ./atom. If you want, you may also put that dir in your PATH env variable: export PATH=$PATH:/home/bpdp/software/atom/usr/bin inside $HOME/.bashrc.

Setting Printer Network HP LaserJet P2035n di Arch Linux

Install paket: hplip dan cups

Aktifkan CUPS dengan menjalankan daemon:

# cupsd

Install driver HP. Siapkan file ppd (hp-laserjet_p2035n-hpijs-pcl3.ppd), diperoleh di /usr/share/ppd/HP/hp-laserjet_p2035n-hpijs-pcl3.ppd.gz. Ekstrak file tersebut di suatu lokasi, setting permission access ke user. Untuk kasus ini, saya meletakkan file tersebut di /home/bpdp/ppd/hp-laserjet_p2035n-hpijs-pcl3.ppd. Ikuti langkah2 berikut:

[root@bpdp-arch ~]# hp-setup -i
HP Linux Imaging and Printing System (ver. 3.15.2)
Printer/Fax Setup Utility ver. 9.0
Copyright (c) 2001-15 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.
(Note: Defaults for each question are maked with a '*'. Press to accept the default.)
  Num       Connection  Description                                              
  --------  ----------  ----------------------------------------------------------
  0*        usb         Universal Serial Bus (USB)                              
  1         net         Network/Ethernet/Wireless (direct connection or JetDirect)
  2         par         Parallel Port (LPT:)                                    
Enter number 0...2 for connection type (q=quit, enter=usb*) ? 1
Using connection type: net
Using device: hp:/net/HP_LaserJet_P2035n?ip=
Setting up device: hp:/net/HP_LaserJet_P2035n?ip=

Please enter a name for this print queue (m=use model name:'HP_LaserJet_P2035n'*, q=quit) ?
Using queue name: HP_LaserJet_P2035n
Locating PPD file... Please wait.
error: No PPD found for model laserjet_p2035n using old algorithm.
error: Unable to find an appropriate PPD file.
Would you like to specify the path to the correct PPD file to use (y=yes, n=no*, q=quit) ? /home/bpdp/ppd/hp-laserjet_p2035n-hpijs-pcl3.ppd
error: Please press or enter 'y', 'n', or 'q'.
Would you like to specify the path to the correct PPD file to use (y=yes, n=no*, q=quit) ? y
Please enter the full filesystem path to the PPD file to use (q=quit) :/home/bpdp/ppd/hp-laserjet_p2035n-hpijs-pcl3.ppd
Description for the file: HP LaserJet p2035n hpijs pcl3, 3.15.2, requires proprietary plugin
Use this file (y=yes*, n=no, q=quit) ? y
Enter a location description for this printer (q=quit) ?Ruang SI Jaringan
Enter additonal information or notes for this printer (q=quit) ?
Adding print queue to CUPS:
Device URI: hp:/net/HP_LaserJet_P2035n?ip=
Queue name: HP_LaserJet_P2035n
PPD file: /home/bpdp/ppd/hp-laserjet_p2035n-hpijs-pcl3.ppd
Location: Ruang SI Jaringan

Would you like to print a test page (y=yes*, n=no, q=quit) ? n
[root@bpdp-arch ~]#

Setelah itu, setiap kali print, akan muncul printer tersebut. Enjoy!