Sunday, May 20, 2012

Laptop HDD head parking


My new ASUS laptop parked the HDD heads over 250,000 times in just 2
day, most HDD's only support 200,000 head parks over the HDD's entire
lifetime.  So how do you turn this off?

First lets check the stats:

%: smartctl -a /dev/sd?

This should display everything you ever wanted to know about the HDD

Load_Cycle_Count is the number of times your HDD has parked it heads.
About 12 times per day is average, NOT over 250,000 in two days.

So how do we turn these off?

%: hdparm -B 255 /dev/sd?

This *should* stop the drive from parking the heads until you turn off
your computer.

%: hdparm -B 254 /dev/sd?

This *should* keep power management on (meaning it will still park the
heads) but not as often.  I issued this command and saw an IMMEDIATE
decline in the number of head parks.  (It also helped stop that annoying
whinny sound I heard everytime the drive spooled up again).

Choose your option.  Turning it off completely is not bad it just uses
more power (I do not know how much more).

To make these permanant:

Check with your linux distribution on slackware I added to the bottom of
/etc/rc.d/rc.local

hdparm -B 254 /dev/sda

(of course you need to add the corresponding letter to your drive, if
its a laptop most likely its /dev/sda)

WebloggerMode

After 4 hours of looking on the internet, and fussing with emacs, I
finally (if this post submits) figured out a way to post to this blog
through emacs, instead of being forced to use the website.

First, load emacs, then paste the following in the buffer

(let ((buffer (url-retrieve-synchronously
      "http://tromey.com/elpa/package-install.el")))
  (save-excursion
    (set-buffer buffer)
    (goto-char (point-min))
    (re-search-forward "^$" nil 'move)
    (eval-region (point) (point-max))
    (kill-buffer (current-buffer))))

Then issue C-j (Command - j)

Then issue M-x (Alt - x) type "package-list-packages" (without the
quotes)

Scroll down until you find WebloggerMode press "i" scroll down to
xml-rpc press "i" then press "x" then edit your ~/.emacs file and add
"(require 'cl)" (without the quotes) to the bottom of the file, save,
restart emacs.

WebloggerMode usage commands:

 M-x weblogger-setup-weblog
 M-x weblogger-start-entry

;; C-x C-s    -- post-and-publish current buffer to the weblog.
;;               Calling weblogger-publish-entry with an prefix argument
;;               (i.e. C-u C-x C-s) will prompt for which weblog
;;               to use.
;; C-c C-c    -- save as draft and bury the buffer.
;; C-c C-n    -- post (but not publish) the current entry and
;;               load the next entry.
;; C-c C-p    -- post (but not publish) the current entry and
;;               load the previous entry.
;; C-c C-k    -- delete the current entry.
;; M-g        -- synchronise weblogger.el's idea of the entries available
;;               with the weblog server.
;; C-c C-t m  -- edit the main template.
;; C-c C-t a  -- edit the Archive Index template
;; C-c C-s s  -- Change the server being used.
;; C-c C-s w  -- Change the weblog.
;; C-c C-s u  -- Change the user (re-login).

You’ll need the “Server Endpoint”. Here are the values for various popular weblogging platforms:

Blogger.com:   http://www.blogger.com/api
Wordpress:     http://BLOG-URL/xmlrpc.php
                       http://hexmode.wordpress.com/xmlrpc.php. http://example.com/weblog/xmlrpc.php)
LiveJournal:     http://www.livejournal.com/interface/blogger/
OpenWeblog:  http://www.openweblog.com/interface/blogger/
MovableType: http://CGI-URL/mt-xmlrpc.cgi
                       http://www.example.com/cgi-bin/mt/mt-xmlrpc.cgi
Drupal: Enable the Blogger API and use http://DRUPAL-URL/xmlrpc.php (like Wordpress).

Thanks to:
     http://www.emacswiki.org/emacs/WebloggerMode
     http://tromey.com/elpa
     irc.freenode.com    #emacs

Saturday, May 19, 2012

Slackware remove Samyak/Oriya

------------------------------------------------------

Please uninstall the Samyak/Oriya font, e.g. 'sudo dpkg -r ttf-oriya-fonts', then log out and

log in again. That font causes strange crashes in .net programs.

------------------------------------------------------


to remove the font package

# its part of the ttf-indic-fonts package, so we need to remove it

removepkg ttf-indic-fonts-0.4.7.4-noarch-1.txz


# There is another refernece to this font in a fonts.dir file, we need to delete that reference or it will think the font is still installed, there are two ways to do this

# run the following commands in the /usr/share/fonts directory

grep -nr samy . | sed 's@\(Samyak\)@@'

grep -nr oriy . | sed 's@\(Oriya\)@@'


**or just emacs /usr/share/fonts/TTF/fonts.dir  Search for Samyak delete that line save**


after the oriya and samyak fonts and all mentions of them are removed, log out and log back in.

Saturday, May 12, 2012

tightvnc


On Host (logged in as user):

vncserver -geometry 720x480

After you press enter, it will tell you which display it will use.  Remember that number as you need it for your guest to connect to the vncserver.

As Guest:

vncviewer ip.address.of.host:displaynumber

example:

vncviewer 123.456.1.99:1

Friday, April 27, 2012

Moon+ Reader Pro Change Book Cover


The programmer really messed things up so here is how you change the book cover

Click on "My Shelf"

Click on "All Books"  (If your book is not added, add it)

Long-Click on the book whose cover you want to change

Click on Edit Book Information

Change cover, edit the title, author, add description tags, etc.  Why it must be done in this section only?

Sunday, January 29, 2012

Conky Transparency Enlightenment

own_window yes
# ARGB can be used for real transparency, note that a composite manager is required for real transparency
own_window_argb_visual true
# Set the transparency alpha value from 0 to 255
own_window_argb_value 0
own_window_type desktop

For Autostart:

alt + right click on your conky
scroll down to settings
click on remember
follow the screen information
make sure to save it to start on boot

Monday, July 25, 2011

chroot into LUKS encrypted drive

# cryptsetup luksOpen /dev/sdx2 slackluks

# vgscan --mknodes

# vgchange -ay

# lvscan

# mount /dev/foo /foo

# mount -o bind /proc /mnt

# mount -o bind /dev /mnt

# mount -o bind /sys /mnt

# mount -o bind /boot /mnt

(mount /boot if on a different HDD if messing with kernel issues etc...)

# mount /dev/foo /mnt

# chroot /mnt /bin/bash