Forgot your password?
typodupeerror
User Journal

Journal: VNC

Journal by marcello_dl

On remote:
# aptitude install tightvncserver

as the user whose desktop you want to share:

$ vncserver

setup passwords, a screen number is issued, usually 1

on local:

# aptitude install xtightvncviewer

as user

$ xtightvncviewer (remote IP address):1
1 is the screen number

notes: killall Xtightvnc kills it on remote

Debian

Journal: Getting Sony Ericsson MD400 Wireless modem to work

Journal by marcello_dl

First install usb-modeswitch package (debian squeeze - that is, testing at the moment - has it)
Then make sure that the udev initialization is correct:
# Sony Ericsson MD400
#
# This is experimental. Might switch back after some time. Please report!
# This might work too instead; subject to testing
# Vendor:Product id = 0x0fce:0xd0e1
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", SYSFS{idProduct}=="d0e1", RUN+="/usr/sbin/usb_modeswitch --default-vendor 0x0fce --default-product 0xd0e1 -O 1"

Then plug the modem in, make sure it doesn't show up as usb disk, then install wvdial.

A working configuration for italian isp wind is the following:

[Dialer Defaults]
Init1 = ATX3
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CFUN=6
Init4 = AT+CGDCONT=1,"ip","internet.wind"
Phone = *99#
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM0
ISDN = 0
Password = wind
Username = wind

Line init4 must be adapted to your ISP.
It is important to have the init3 line which turns the radio on. 6 means use HSDPA only, other values might be require if you don't have cover or other subscription, but beware the cost and speed. Why does a modem that works only with radio signals need to explicitly turn on its radio is beyond me. Good luck.

Debian

Journal: Scanner permissions with udev

Journal by marcello_dl

in /etc/udev/rules.d/91-permissions.rules, after first line put:
SUBSYSTEMS=="usb", ATTRS{product}=="xxxx", GROUP="scanner"

Note it is SUBSYSTEMS plural
The correct attr can be seen on dmesg, or udevinfo -a -p /sys/class/usb_device/usbdev5
Optionally put vendor too.

User Journal

Journal: Fix usb issue

Journal by marcello_dl

if device=sdb, edit S03mountkernfs.sh

        #CUSTOM ugly hack
            echo 1024 > /sys/block/sdb/device/max_sectors
            echo 1 > /sys/block/sdb/device/scsi_disk/*/allow_restart

Debian

Journal: Linode config

Journal by marcello_dl

First of all, aptitude-upgrading, the debian image still has the random number gen. vulnerability. I went for lenny so i have a recent git and postgresql 8.3

Did tzsetup, and aptitude installed locales
added a normal user

Linode configures with DHCP his servers. Might have advantages but i prefer a static one

iface eth0old inet dhcp

iface eth0 inet static
        address (...)
        netmask 255.255.255.0
        gateway (...)
        dns-nameservers 207.192.69.4 207.192.69.5

and put a name in /etc/hostname

Then installed arno-iptables-firewall.
Opened ports 80 443 (it's gonna be a server)
FULL_ACCESS_HOSTS="(my machine domain name)"
FIREWALL_LOG=/var/log/firewall
LOGLEVEL=debug

then
touch /var/log/firewall

in /etc/syslog.conf kern.* must be changed to kern.!=debug
and the following added:
      # Logging for iptables
      kern.=debug -/var/log/firewall

then /etc/init.d/sysklogd restart

and restart arno firewall

To prevent firewall messages on lish console out add to /etc/init.d/klogd:

KLOGD="-c 4"

And restart that one too.

Better use logrotate too, see
http://linuxgazette.net/114/keeling.html

in /etc/logrotate/logrotate.d /var/log/firewall {
                      rotate 7
                      daily
                      compress
                      notifempty
                      create 0640 root adm
                      delaycompress
                      create
}

and start logrotate to see if it kinda works /usr/sbin/logrotate /etc/logrotate.conf

Rails server:
installed exim4-daemon-light postgresql lighttpd ruby ruby1.8-dev irb liberb-ruby libpgsql-ruby1.8 libredcloth-ruby1.8 rdoc1.8 libfcgi-ruby1.8 rubygems rake

then:
gem install rails
(wait)

make sure the correct version for your app is present, too
gem install -v=2.0.2 rails

Postgres users need postgres gem
aptitude install postgresql-server-dev-(version) make

gem install postgres

lighty-enable-module to add fastcgi and ssl
but then removed the entries in conf-enabled dir


# Debian lighttpd configuration file
#

############ Options you really have to take care of ####################

## modules to load
# mod_access, mod_accesslog and mod_alias are loaded by default
# all other module should only be loaded if neccesary
# - saves some time
# - saves memory

server.modules = (
        "mod_fastcgi",
                        "mod_access",
                        "mod_alias",
                        "mod_accesslog",
                        "mod_compress",
                      "mod_rewrite",
# "mod_redirect",
# "mod_evhost",
# "mod_usertrack",
# "mod_rrdtool",
# "mod_webdav",
                      "mod_expire",
# "mod_flv_streaming",
# "mod_evasive"
)

## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/var/www/"

## where to upload files to, purged daily.
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )

## where to send error-messages to
server.errorlog = "/var/log/lighttpd/error.log"

## files to check for if .../ is requested
index-file.names = ( "index.php", "index.html",
                                                              "index.htm", "default.htm",
                                                              "index.lighttpd.html" )

## Use the "Content-Type" extended attribute to obtain mime type if possible
# mimetype.use-xattr = "enable"

#### accesslog module
accesslog.filename = "/var/log/lighttpd/access.log"

## deny access the file-extensions
#
# ~ is for backupfiles from vi, emacs, joe, ...
# .inc is often used for code includes which should in general not be part
# of the document-root
url.access-deny = ( "~", ".inc" )

##
# which extensions should not be handle via static-file transfer
#
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

######### Options that are good to be but not neccesary to be changed #######

## Use ipv6 only if available.
#include_shell "/usr/share/lighttpd/use-ipv6.pl"

## bind to port (default: 80)
# server.port = 81

## bind to localhost only (default: all interfaces)
server.bind = "(server's IP)"

## error-handler for status 404
#server.error-handler-404 = "/error-handler.html"
#server.error-handler-404 = "/error-handler.php"

## to help the rc.scripts
server.pid-file = "/var/run/lighttpd.pid"

##
## Format: .html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/var/www/"

## virtual directory listings
dir-listing.encoding = "utf-8"
server.dir-listing = "disable"

## send unhandled HTTP-header headers to error-log
#debug.dump-unknown-headers = "enable"

### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot = "/"

## change uid to (default: don't care)
server.username = "www-data"

## change uid to (default: don't care)
server.groupname = "www-data"

#### compress module
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ("text/plain", "text/html", "application/x-javascript", "text/css")

#### url handling modules (rewrite, redirect, access)
# url.rewrite = ( "^/$" => "/server-status" )
# url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )

#
# define a pattern for the host url finding
# %% => % sign
# %0 => domain name + tld
# %1 => tld
# %2 => domain name without tld
# %3 => subdomain 1 name
# %4 => subdomain 2 name
#
# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"

#### expire module
# expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")

#### rrdtool
# rrdtool.binary = "/usr/bin/rrdtool"
# rrdtool.db-name = "/var/www/lighttpd.rrd"

#### variable usage:
## variable name without "." is auto prefixed by "var." and becomes "var.bar"
#bar = 1
#var.mystring = "foo"

## integer add
#bar += 1
## string concat, with integer cast as string, result: "www.foo1.com"
#server.name = "www." + mystring + var.bar + ".com"
## array merge
#index-file.names = (foo + ".php") + index-file.names
#index-file.names += (foo + ".php")

#### external configuration files
## mimetype mapping
include_shell "/usr/share/lighttpd/create-mime.assign.pl"

## load enabled configuration files,
## read /etc/lighttpd/conf-available/README first
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

#### handle Debian Policy Manual, Section 11.5. urls
## by default allow them only from localhost
## (This must come last due to #445459)
## Note: =~ "127.0.0.1" works with ipv6 enabled, whereas == "127.0.0.1" doesn't
$HTTP["remoteip"] =~ "127.0.0.1" {
        alias.url += (
                "/doc/" => "/usr/share/doc/",
                "/images/" => "/usr/share/images/"
        )
        $HTTP["url"] =~ "^/doc/|^/images/" {
                dir-listing.activate = "enable"
        }
}

# lighttpd.conf entry to transparently add ssl
#$SERVER["socket"] == "(your server's IP):443" {
# ssl.pemfile = "/var/www/ ... /key-cert.pem"
# ssl.ca-file = "/var/www/ ... /cacert.pem"
# ssl.engine = "enable"
#}

$HTTP["host"] =~ "(^|\.)hostname$" {

server.error-handler-404 = "/dispatch.fcgi"
server.document-root = "/var/www/ railsapp /public/"

server.errorlog = "/var/www//log/lighttpd.error.log"
accesslog.filename = "/var/www/ railsapp /log/lighttpd.access.log"

url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )

compress.filetype = ( "text/plain", "text/html", "text/css", "text/javascript" )
compress.cache-dir = "/var/www/ railsapp /tmp/cache"
expire.url = ( "/favicon.ico" => "access 3 days",
                                                          "/images/" => "access 3 days",
                                                          "/stylesheets/" => "access 3 days",
                                                          "/javascripts/" => "access 3 days" )

fastcgi.server = ( ".fcgi" => ( "localhost" => (
    "min-procs" => 1,
    "max-procs" => 1,
    "socket" => "/var/www/ railsapp /tmp/sockets/fcgi.socket",
    "bin-path" => "/var/www/ railsapp /public/dispatch.fcgi",
    "bin-environment" => ( "RAILS_ENV" => "production" )
) ) )

}

Postgresql
# su - postgres
now, a user same name of your linux user who own the app
$ createuser (username) -P (give him no special privileges)
$ createdb -E UTF8 (dbname)

edit pg_hba.conf (somewhere in /etc/postgresql/...)
# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL listen
# on a non-local interface via the listen_addresses configuration parameter,
# or via the -i or -h command line switches.
#
host (dbname) (www-data = username) 127.0.0.1 255.255.255.255 trust

Tried copying the rails app(s) to /var/www and work under user www-data

to make changes effective restart postgresql and lighttpd

Debian

Journal: quick and dirty postgresql update- tutorial

Journal by marcello_dl

Note, this procedure involves some downtime for the server.
First dump existing databases, e.g.

# su - postgres -c 'pg_dump -C my_database > /tmp/my_database.sql'

If you have user putting content into database this step could be done later, just before importing the sql in the new cluster. Remember to take down db clients if you care for db consistency.

Then install new version, e.g.

# aptitude install postgresql-8.3

when one installs a new version of postgres under debian, the old version stays installed and a new cluster is automatically created. The new version server is configured for an alternative port (5433). Watch for the messages/logs from the package manager.

Then import old users into the new cluster, take into account the listening port run the updated client as the bash command "psql" defaults to the old version.

# su - postgres
# createuser a_user --port 5433

Then copy or update the pg_hba.conf settings to the one in the new cluster in /etc/postgresql/8.3/main/pg_hba.conf

Do not forget to reload the settings.
# /etc/init.d/postgresql-8.3 reload

Then import the databases
# su - postgres
$ /usr/lib/postgresql/8.3/bin/psql --port 5433

Then configure the new server for the existing server port, e.g.
# /etc/init.d/postgresql-8.3 stop
edit /etc/postgresql/8.3/main/postgresql.conf:
    port=5432

Then stop the db clients (eg. it's downtime for my dynamic sites hosted with lighttpd), take down old db, take up new one, restart db clients /etc/init.d/lighttpd stop /etc/init.d/postgresql-8.2 stop /etc/init.d/postgresql-8.3 start
    netstat -nat /etc/init.d/lighttpd start

test the db clients (restart your browser for webapps to avoid using stale session data), if all is well we must remove old postgresql else at reboot it is restarted, conflicting with the newest server version.

Since the debian remove scripts assume the server is up we must take the old server back up- we need to configure the old server for an alternative port so both versions can be up at the same time, e.g.

edit /etc/postgresql/8.3/main/postgresql.conf:
    port=5434

# /etc/init.d/postgresql-8.2 start
# aptitude purge postgresql-8.2

This is all.
Note. It is better to upgrade incrementally than doing it say, from 8.1 to 8.3
There might be ways to reduce downtime, with WAL for example.

User Journal

Journal: Rails: typo (todo)

Journal by marcello_dl

apt-get install sqlite3 libsqlite3-dev
gem install sqlite3-ruby
of course all ruby dev and rails stuff must be already installed

gem install typo /to be continued
    517 mkdir blog
    518 cd blog/
    519 typo config .
    520 typo config . database=postgresql
    521 ls
    522 ls -a
    523 typo install --help
    524 rm ./* -rf
    525 typo install .
    526 typo stop .
    527 cat installer/lighttpd.conf.example
    528 typo config . database=postgresql
    529 typo config . web-server=external
    530 nano config/database.yml
    531 echo edit pg_hba.conf
    532 echo createdb typo -E UTF8
    533 rake db:migrate
    534 nano config/database.yml
    535 cp ../GaraTiro/config/database.yml config/database.yml
    536 nano config/database.yml
    537 rake db:migrate
    538 echo edit lighttpd.conf
    539 echo "$HTTP["host"] =~ "typo.jasonhoffman.org" {
server.document-root = "/home/jah/apps/typo/trunk/public/"
server.error-handler-404 = "/dispatch.fcgi"
server.indexfiles = ( "dispatch.fcgi")
server.errorlog = "/home/jah/logs/error.typo.log"
    fastcgi.server = ( ".fcgi" =>
          ( "localhost" =>
              ( "socket" => "/home/jah/tmp/typo-jah.socket",
                                                        "min-procs" => 2,
                                                        "max-procs" => 2,
                  "bin-path" => "/home/jah/apps/typo/trunk/public/dispatch.fcgi",
                  "bin-environment" => ( "RAILS_ENV" => "production" )
    )))
}
"
    540 ls
    541 ls log/
    542 touch log/lighttpd.error.log
    543 typo config . port=80
    544 typo config . rails-environment=development
    545 typo config .
    546 chown marcello:www-data .
    547 #change lighttpd user as same as app

Debian

Journal: Compiz fusion (gnome) for intel X3100

Journal by marcello_dl

As root:

edit /etc/X11/xorg.conf

If no extensions section add one, see below. Add the option anyway.

Section "Extensions"
                Option "Composite" "Enable"
EndSection

and in Section Devices add

        Option "XAANoOffscreenPixmaps" "true"

add to /etc/apt/sources.list
#compiz
deb http://download.tuxfamily.org/osrdebian unstable compiz-fusion-git

download the pgp key
wget http://download.tuxfamily.org/osrdebian/61B8DB62.gpg -O- | apt-key add -

install:

apt-get remove --purge compiz*
aptitude dist-upgrade
apt-get install -t unstable compiz-core compiz-gnome compizconfig-settings-manager compiz-fusion-plugins*

maybe it is needed the following too:
aptitude install 915resolution

As the logged in user, with the graphical desktop already running:
SKIP_CHECKS=yes compiz --replace

One can also install emerald and emerald-themes, possibly purging and reinstalling at every update.

Debian

Journal: Packet writing

Journal by marcello_dl

Verify you have the modules (recent 2.6 kernel needed stock lenny works)
modprobe -v udf
modprobe -v pktcdvd

aptitude install udftools
put your cdrom device in /etc/default/udftools
e.g. dev/hdX /etc/init.d/udftools restart

cdrwtool -d /dev/hda -q for a cdrw
dvd+rw-format /dev/hdd
and mkudffs /dev/hdd for dvd+rw

mount -t udf -o noauto,noatime,sync,rw,users /dev/pktcdvd/0 /mnt/

Now root is able to write on device, adjust permissions.

The number of arguments is unimportant unless some of them are correct. -- Ralph Hartley

Working...