Personal notes - Reminders


i3 configuration

urxvt Tabs

To control tabs use:

Shift+ ↓ new tab

Shift+ ← go to left tab

Shift+ → go to right tab

Ctrl+ ← move tab to the left

Ctrl+ → move tab to the right

Ctrl+D: close tab

~/.xinitrc

exec i3
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

~/.Xresources

! terminal colors

! tangoesque scheme                                                            
*background: #111111
*foreground: #babdb6                                                           
! Black (not tango) + DarkGrey                                                 
*color0:  #000000
*color8:  #555753                                                              
! DarkRed + Red                                                                
*color1:  #ff6565                                                              
*color9:  #ff8d8d
! DarkGreen + Green                                                            
*color2:  #93d44f                                                              
*color10: #c8e7a8                                                              
! DarkYellow + Yellow
*color3:  #eab93d                                                              
*color11: #ffc123                                                              
! DarkBlue + Blue                                                              
*color4:  #204a87
*color12: #3465a4                                                              
! DarkMangenta + Mangenta                                                      
*color5:  #ce5c00                                                              
*color13: #f57900
!DarkCyan + Cyan (both not tango)                                              
*color6:  #89b6e2                                                              
*color14: #46a4ff                                                              
! LightGrey + White
*color7:  #cccccc                                                              
*color15: #ffffff                                                              

URxvt.scrollBar: false
URxvt.perl-ext-common:  default,tabbed                                         

! fonts                                                                         
URxvt.font: xft:terminus:size=10

~/.i3/config

...
...
# execute my startup program
exec ~/.i3startup

~/.i3startup

#!/bin/bash                                      
# Login startup                                  

feh --bg-fill /home/ruff/Immagini/Debian_Red.png
i3status | dzen2 -x 400 -y 750 &

wallpaper


Charset / Fonts

Codifica dei caratteri

Fonts


exim4

Password generation for smtp auth (/etc/exim4/passwd):

htpasswd -nd usernameforsmtp

notes for Exim administration

Log file is located at /var/log/exim4/mainlog

See some general stats: eximstats -nr /var/log/exim4/mainlog

See current activity: exim4 -bp | exiqsumm

See the # of messages in the queue: exim4 -bpc

See undelivered messages in the queue: exim4 -bpu

See what the actual processes are doing: exiwhat

Checking mailbox size: du -hsc * (run in /home)

The configuration template is in /etc/exim4/update-exim4.conf.conf and the actual config file in in /var/lib/exim4/config.autogenerated

Regenerate the config file from the template: update-exim4.conf

Reload the configuration: invoke-rc.d exim4 reload

Send a test message: send "content" | mail -s "subject" user@example.com

Send a message without "send": echo "body" | mail -s "subject" user@example.com

Process the queue: exim -q -v

Process the queue, ignoring retry times: exim -qf -v

Process the queue, including even frozen messages: exim -qff -v

To see the contents of a specific message: exim -Mvc messageid


netsh IPv6 Windows

netsh winsock reset all
netsh int 6to4 reset all
netsh int ipv4 reset all
netsh int ipv6 reset all
netsh int httpstunnel reset all
netsh int isatap reset all
netsh int portproxy reset all
netsh int tcp reset all
netsh int teredo reset all

Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes

This was my first hurdle with Node.js, and it could've been a deal-breaker. You see, most Node.js libs/utils are designed to be installed using NPM (Node Package Manager), and installing them (and their dependencies) by hand is a pain in the rear ... but NPM wants to be installed and run as root. In other words, sudo npm install possible-trojan-horse. Screw that! One rogue package, and you're PWNED. Also, that won't work in a shared hosting environment, which has some big advantages over virtualization. I/O throughput, for instance.

Fortunately, there's a simple workaround. I'd like to see this become the default NPM setup.

2012.05.08 Update:

  • NPM has been included with Node.js for a few months now, so I removed the part about installing it separately. It's now VERY EASY to install it the right way from source (which I recommend).
  • If you use a binary installer/package, you can still run npm install -g without being root -- just follow these instructions and skip step 2.
  • On OSX, your mileage may vary. The Node/OSX situation changes from month to month. I'll take another look at it soon.
  • Unfortunately the Nodejs docs still says to do it the wrong way (using sudo). There are a bunch of open issues involving "sudo" and "root". I'll see what I can do.
  • Rant: the deeper I dig, it looks like OSX is a bad influence on Node, NPM, and developers in general. Ubuntu too. Node is useful all around, but it's primarily a server thing. Real servers run CentOS, RHEL, Debian, FreeBSD, maybe even Windows... not OSX/Ubuntu.

INSTALLING Node+NPM

This will install Nodejs under ~/.local/ instead of the default /usr/local/

  1. Add this to your ~/.npmrc (create the file if it doesn't exist already):

    root =    /home/YOUR-USERNAME/.local/lib/node_modules
    binroot = /home/YOUR-USERNAME/.local/bin
    manroot = /home/YOUR-USERNAME/.local/share/man
    
  2. Download the Nodejs source code from nodejs.org and install it under your ~/.local tree:

    tar xf node......
    cd node........
    ./configure --prefix=~/.local
    make
    make install
    
  3. Create ~/.node_modules symlink. (This directory will be automatically searched when you load modules using require "module" in scripts. I'm not sure why Node doesn't search ~/.local/lib/node_modules by default.)

    cd
    ln -s .local/lib/node_modules .node_modules
    
  4. Is ~/.local/bin in your path? Type

    which npm
    

    If it says ~/.local/bin/npm, you're done.

    Otherwise, do this...

    export PATH=$HOME/.local/bin:$PATH
    

    ...and add that line to your ~/.profile file, so it'll run every time you log in.

    (Note: Unixes are adopting on ~/.local as the standard per-user program/library location, but they're not all there yet.)

INSTALLING PACKAGES (quick summary for Node.js newbies)

Global package installation under ~/.local (for libraries you use a lot, and command-line tools like coffee-script and jade and jslint):

npm install -g PACKAGE [PACKAGE2 PACKAGE3 ...]

Local package installation under $PWD/node_modules (redundant, but that's the point -- different packages can use different versions of the same dependency):

npm install PACKAGE [PACKAGE2 PACKAGE3 ...]

To locally install packages specified in package.json, just run:

npm install

CREDITS

I distilled these instructions from this which I found thanks to a comment here.

A few weeks later, I stumbled across Dave Stevens' instructions for installing Node+NPM on Webfaction which were more straightforward.


git notes

Adding github as a remote via ssh

git remote add github git@github.com:roughnecks/BirbaBot.git

# test the results
git remote -v

Changing remote address

git remote set-url github git@github.com:roughnecks/<some-other>.git
# or a completely different url, like an https one instead of "git@"

Initialize a new git repository

git init --bare --shared=group repodir.git
chgrp -R groupname repodir.git

First commit and relative push

git push -u origin master

DeltaCopy - rsync for windows (failed file name too long (91))

Eliminating DeltaCopy's "File name too long" Errors

I use the Windows rsync server DeltaCopy to backup files from a Windows 7 box using a nightly cron job running on a FreeBSD server. DeltaCopy is a wrapper that runs the Cygwin rsync binaries as a Windows Service. This all works well out of the box with one exception: the version of Cygwin bundled with DeltaCopy doesn't support long file paths, so I get a bunch of failed copies in my nightly backup logs, like this:

rsync: readlink_stat("Profiles/07b6fq5u.default/Mail/Local Folders/Eudora Mail.sbd/Read.mozmsgs/!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAA9XtW%2Fsf8BUe37SpujdFeE8KAAAAQAAAABb%2BHEGlU%2FkaQ5j0m1KGNZgEAAAAA%40earthlink.net.wdseml" (in mail)) failed: File name too long (91)

The solution is to upgrade the Cygwin libraries that are used by DeltaCopy. The current versions (1.7.7) solve this problem and are compatible with DeltaCopy. You also need to add a couple of lines to the DeltaCopy configuration file.

There are quite a few posts on this subject on line offering solutions for this, but I did not find any that contained all of the correct information in one place, so here's what worked for me (Windows 7, DeltaCopy 1.3, Cygwin 1.7.7).

  1. Download the Cygwin installer (setup.exe) available from the Cygwin website
  2. Install the base packages, plus Net/openssh and Net/rsync
  3. Stop the DeltaCopy server (either from the Control Panel or using DeltaS)
  4. Copy the files below from the Cygwin installation path (eg C:\Cygwin\bin) to your DeltaCopy installation path (eg C:DeltaCopy).

    chmod.exe
    cygcrypto-0.9.8.dll
    cyggcc_s-1.dll
    cygiconv-2.dll
    cygintl-8.dll
    cygminires.dll (no longer required)
    cygpopt-0.dll
    cygwin1.dll
    cygz.dll
    rsync.exe
    ssh.exe
    
  5. Edit C:DeltaCopy\deltacd.conf and add the following two lines at the beginning of the file.

    uid = 0
    gid = 0
    
  6. Restart the DeltaCopy service

    • roughnecks' note: dlls versions may change as Cygwin gets updated.

Thunderbird

Thunderbird forward as html

Hold the "shift" key while clicking the forward button/link

Thunderbird e Squirrelmail

tip

Se inviamo posta in solo testo e in UTF-8 da Thunderbird, tutte le accentate tipiche di molte lingue, tra le quali l'italiano, andranno perse in squirrelmail. Unica soluzione trovata è quella di impostare Thunderbird per l'invio in testo ed HTML - Strumenti, Opzioni, Composizione, Opzioni di invio..