Init-script for php-cgi in external FASTCGI Mode (Daemon mode) или Заебали постить код в ворпрессах, суки!

|

Устанавливаем php5-cgi (в деб/бунту, в остальных отстойниках не пробовал :D), далее это файл в /etc/init.d/php-fastcgi, этот в /etc/default/php-fastcgi.

$ sudo chmod +x /etc/init.d/php-fastcgi
$ sudo update-rc.d php-fastcgi defaults

тестим: $ sudo /etc/init.d/php-fastcgi start

и пиздец идём пить пиво и настраивать нгинкс =))

Compressing a directory with rar on Linux

|

You want to compress dir2 from /dir1/dir2, but still want directory to remain in archive.

/$ cd dir1
/dir1$ rar a -R output.rar dir2/

That's is, have fun!

Emacs config file (~/.emacs)

|

My current ~/.emacs file

;;; additional load path, for non-standard modules,
;;; comment out this, if you need this
;(setq load-path (cons "~/share/emacs" load-path))

; general
(setq inhibit-startup-message t)

; enable Transient Mark mode
(transient-mark-mode 1); In Transient Mark mode, the region is active only temporarily, and it is highlighted while it is active

; enable Ctrl+C, Ctrl+V, Ctrl+X hotkeys
(cua-mode t)
(transient-mark-mode 1) ;; No region when it is not highlighted
(setq cua-keep-region-after-copy t) ;; Standard Windows behaviour

; stop inserting tab characters and insert spaces instead
(setq-default indent-tabs-mode nil)

; set standard indent to 4
(setq standard-indent 4)

(require 'blank-mode)
(global-blank-mode 1)

; automatically indent after a return
(global-set-key "\C-m" 'newline-and-indent)

; Make emacs highlight bracket pairs:
(show-paren-mode t)

; Stop emacs from doing jumps when scrolling.
(setq scroll-step 1)

; Preventing the creation of backup files
(setq make-backup-files nil)

Mootools skeleton class

|

Mootools skeleton class

var SomeClass = new Class({
    Implements: [Events, Options],

    version: 0.1, //some version

    options :
    {
        option1: "",
        option2: 5,
        option3: null,
    },

    // constructor
    initialize: function(obj, options)
    {
        this.obj = obj;
        this.setOptions(options);

    someFunction: function()
    {
        // body goes here
    },
});

SomeClass.implement(new Events, new Options);

First 15 minutes in Hardy

|

First things I need to do after fresh install of Hardy (maybe any other *buntu distro)

  1. go to aptitude ($ sudo aptitude) and disable installing recommended packages (Top Menu -> Options-> Preferences-> disable "Install recommended packages automatically" option)

How to install last OpenSSH (5) in etch or lenny

|

Simple as eat an apple =)

$ sudo apt-get build-dep openssh-server
$ sudo aptitude install fakeroot

after installing all these packages. Download sources of openssh. at the bottom of the page, something like openssh_5.1p1-2.dsc, openssh_5.1p1.orig.tar.gz, openssh_5.1p1-2.diff.gz.

Next... RTFM =). And you are done! Have fun!

Blogger Markdown support user script (via showdown)

|

You don't need to transform blog post to html (via Markdown link (forgot to delete it :D )). Also when you editting, you pretty markdown, STILL!

Have fun!