archan’s emacs 20022014
February 20, 2014
;; emacs 18022014 arp@archan.org ;; add package repository and install missing packages (require 'package) (setq package-archives '(("melpa" . "http://melpa.milkbox.net/packages/"))) (setq package-list '(autopair dart-mode flymake-cursor flymake-google-cpplint flymake-python-pyflakes flymake-easy google-c-style jedi-direx direx jedi auto-complete epc ctable concurrent deferred pony-mode popup web-mode)) ;; find : C-h v package-activated-list (package-initialize) (when (not package-archive-contents) (package-refresh-contents)) (dolist (package package-list) (when (not (package-installed-p package)) (package-install package))) ;; default customization (custom-set-variables '(inhibit-splash-screen t) '(inhibit-startup-message t) '(tool-bar-mode nil) '(column-number-mode t) '(cua-mode 1 nil (cua-base)) '(global-font-lock-mode 1) '(global-linum-mode t) '(ido-mode t nil (ido)) '(make-backup-files nil) '(show-paren-mode t) ) ;; set all windows (emacs's “frames”) to some defaults (setq initial-frame-alist '((width . 100) (height . 54))) (setq default-frame-alist '((menu-bar-lines . 1) (left-fringe) (right-fringe) (tool-bar-lines . 0) (width . 100) (height . 52) )) (set-frame-parameter nil 'font "Dejavu Sans Mono-9") (global-hl-line-mode 1) ;(load-theme 'misterioso) (set-face-background 'highlight "white smoke") ;; Prevent accidentally killing emacs. (global-set-key [(control x) (control c)] '(lambda () (interactive) (if (y-or-n-p-with-timeout "Exit Emacs ? " 4 nil) (save-buffers-kill-emacs)))) ;; enable autopairing (require 'autopair) (autopair-global-mode) (setq autopair-autowrap t) ;; custom key-bindings (define-key global-map (kbd "RET") 'newline-and-indent) (global-set-key "\M-l" 'goto-line) (global-set-key (kbd "<f2>") 'save-buffer) (global-set-key (kbd "<f10>") 'switch-to-buffer) (global-set-key (kbd "<f11>") 'next-buffer) (global-set-key (kbd "<f12>") 'prev-window) (defun prev-window () (interactive) (other-window -1)) ;; text-mode hooks (add-hook 'text-mode-hook 'text-file-handle) (defun text-file-handle() (turn-on-auto-fill) (set-fill-column 80) (setq indent-tabs-mode nil ) (setq tab-width 4 ) ) ;; python-mode hooks (require 'python-mode) (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) (add-hook 'python-mode-hook 'python-file-handle) (defun python-file-handle() ; remove whitespaces (add-hook 'before-save-hook 'delete-trailing-whitespace) ; python indentation (setq indent-tabs-mode t) (setq tab-width (default-value 'tab-width)) ) ; flymake-python-pyflakes (require 'flymake-python-pyflakes) (add-hook 'python-mode-hook 'flymake-python-pyflakes-load) (setq flymake-python-pyflakes-executable "flake8") ; python-jedi auto-complete (require 'jedi) (add-hook 'python-mode-hook 'jedi:setup) (setq jedi:setup-keys t) (setq jedi:complete-on-dot t) ; flymake faces (custom-set-faces '(flymake-errline ((((class color)) (:background "ivory1")))) '(flymake-warnline ((((class color)) (:background "ivory2"))))) ;; dart-mode hooks (require 'dart-mode) (add-to-list 'auto-mode-alist '("\\.dart\\'" . dart-mode)) (add-hook 'dart-mode-hook 'dart-file-handle) (defun python-file-handle() )
বহুদিন ধরে’ বহু ক্রোশ দূরে
July 10, 2013
বহুদিন ধরে’ বহু ক্রোশ দূরে
বহু ব্যয় করি বহু দেশ ঘুরে
দেখিতে গিয়েছি পর্ব্বতমালা
দেখিতে গিয়েছি সিন্ধু।
দেখা হয় নাই চক্ষু মেলিয়া
ঘর হতে শুধু দুই পা ফেলিয়া
একটি ধানের শিষের উপরে
একটি শিশির বিন্দু।।
– রবীন্দ্রনাথ ঠাকুর
HOWTO on running Tizen on ArchLinux (using Ubuntu chroot)
April 24, 2013
Here is my honest confession about Ubuntu and Tizen. I seriously dislike them as they are bloated and designed & developed by nuts. Anyway, I wanted the Tizen SDK to run on my ArchLinux box (for code review & curiosity).
Here is the HOWTO on running Tizen on ArchLinux (using Ubuntu chroot) : I know it is SICK!!
Create preliminary Ubuntu chroot in ArchLinux :
-
aurget –deps -Sy –nodiscard –noedit –noconfirm –asroot debootstrap
-
mkdir /home/ubuntu-chroot
-
cd /home/ubuntu-chroot
-
debootstrap –arch=amd64 quantal ubuntu-quantal-amd64 http://192.168.17.10:3142/archive.ubuntu.com/ubuntu/
-
ln -s /proc/mounts ubuntu-quantal-amd64/etc/mtab
-
rm ubuntu-quantal-amd64/etc/resolv.conf
-
echo “nameserver 8.8.8.8” > ubuntu-quantal-amd64/etc/resolv.conf
-
echo “log:x:19:” >> ubuntu-quantal-amd64/etc/group
-
update /etc/apt/sources (curl http://192.168.17.10/public/apt-cacher/sources.list > ubuntu-quantal-amd64/etc/apt/sources.list )
Chrooting to Ubuntu chroot :
-
cat chroot-to-ubuntu.sh
xhost +
mount -o bind /proc/ ubuntu-quantal-amd64/proc/
mount -o bind /dev/ ubuntu-quantal-amd64/dev/
LC_ALL=en_US.UTF-8 chroot ubuntu-quantal-amd64 bash
killall -gq dbus-launch
killall -gq /usr/lib/rtkit/rtkit-daemon
sleep 3
umount ubuntu-quantal-amd64/proc/
umount ubuntu-quantal-amd64/dev/
Setting-up Ubuntu chroot :
-
apt-get update
-
apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 16126D3A3E5C1192
-
apt-key adv –keyserver keyserver.ubuntu.com –recv-keys C2518248EEA14886
-
dpkg-divert –local –rename –add /sbin/initctl
-
ln -sf /bin/true /sbin/initctl
-
apt-get -y –no-install-recommends install locales wget curl debconf devscripts gnupg vim aptitude mc
-
apt-get -y –no-install-recommends install build-essential git-core
-
locale-gen en_US.UTF-8
-
update-locale en_US.UTF-8
-
ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
-
adduser USERNAME
-
gpasswd -a USERNAME root
-
gpasswd -a USERNAME users
-
gpasswd -a USERNAME sudo
Apps/themes [optional] :
-
apt-get -y –no-install-recommends install vim-gtk
-
apt-get -y –no-install-recommends install gtk2-engines-oxygen gtk3-engines-oxygen oxygen-icon-theme
-
echo “gtk-theme-name = \”oxygen-gtk\”” > /etc/gtk-2.0/gtkrc
-
echo “gtk-icon-theme-name = \”oxygen\”” >> /etc/gtk-2.0/gtkrc
-
echo “gtk-font-name = \”Liberation Sans 9\”” >> /etc/gtk-2.0/gtkrc
-
cat /etc/gtk-2.0/gtkrc > /etc/gtk-3.0/gtkrc
Preparing for Tizen development :
-
apt-get –no-install-recommends install oracle-java6-installer
-
apt-get -y –no-install-recommends install procps gettext libdbus-1-3 libcurl3 expect gtk2-engines-pixbuf grep zip make qemu-user-static libwebkitgtk-1.0-0 libgnome2-0 pciutils libxtst6 libglu1-mesa libv4l-0
-
apt-get -y –no-install-recommends install xdg-utils unzip
-
apt-get -y –no-install-recommends install qemu-kvm
-
su – USERNAME
-
mkdir -p ~/.local/share/desktop-directories/
-
wget http://download.tizen.org/sdk/InstallManager/tizen-sdk-2.0-ubuntu64.bin
-
bash ./tizen-sdk-2.0-ubuntu64.bin
-
su – tizen-dev
- /home/tizen-dev/tizen-sdk/ide/startup.sh &
New year morning 2013
January 1, 2013
Today I woke up and Aditri greeted me with a big smile. Can’t expect a better new year morning.
Xoom-ing into ICS
July 14, 2012
I got really impatient due to non-availability of ICS/JB for my Motorola Xoom MZ601. So, I decided to hack and switch to MZ604 firmware for GED Xoom to receive OTA update of ICS build. I had to compromise with non-working 3G, but it is okay for time-being …(till my next hack).
Here is the quick howto :
- Make sure to have adequate (full) charge in your Xoom.
- Download the official Build HWI69 for US Retail from Motorola device software page.
- Switch to fastboot mode by holding “vol down” + “power” buttons (ref).
- Connect the Xoom with Computer (Linux/Windows/Mac – assuming that you have the Android tools/drivers installed).
- Run following commends from terminal (you may void your warranty)
- fastboot oem unlock
- Following on-screen instructions.
- fastboot reboot
- Once rebooted, switch back to bootloader
- adb reboot bootloader
- Wait for the reboot and switch to fastboot mode
- From the terminal change to MZ604 firmware directory where you unzipped official Build HWI69 for US Retail firmware.
- cd /home/experiments/MZ604_HWI69/
- fastboot flash boot boot.img
- fastboot flash system system.img
- fastboot flash recovery recovery.img
- fastboot flash userdata userdata.img
- fastboot erase cache
- fastboot reboot
- Once rebooted, you will get HW169 firmware loaded into Xoom.
- Connect to WiFi and do system update (OTA process).
- You should get automatic OTA which will upgrade firmwares in sequence :
- HMJ37 -> HTJ85B -> HTK55D -> HTK75D -> IML77
- Once you have IML77, you are into ICS (android ice cream sandwich 4.0)
- Finally, a factory is not a bad thing to do.
Enjoy.
Did I forgot to say that I am not responsible for any damages caused by using above instructions?
Our new car – WagonR 2012
June 13, 2012
Galaxy Nexus time
May 28, 2012
After a long wait of one month, today I got my Galaxy Nexus delivered.
The pure Google Android experience begins 🙂
- 4.65″ HD(1280 x 720) Super AMOLED with Contour Display
- TI OMAP 4460, 1.2 GHz Cortex-A9 processor
- 1GB RAM, 16GB flash
- 5MP continuous auto focus, 1080p video recording
- Sensors – NFC, Accelerometer, Gyro, Compass, Proximity/Light, Barometer
- For details, click here
Thanks Akshat for getting it.