psshfs in DragonFlyBSD

How I got mount_psshfs(8) to work.

mount_psshfs basically offers the same functionality as sshfs(1). Putting it to work is quite easy but it is not enabled by default, so some work is required.

0) Set up ssh keys

1) Build, install and boot a new kernel which includes the following parameters. Here is how.
 pseudo-device putter # PUFFS(4)
options PUFFS #Pass-to-Userspace Framework File System

Alternatively, just load the module
kldload puffs

2) Add device rules in /etc/devfs.conf
 perm putter root:wheel 0666

3) Enable vfs.usermount
In /etc/sysctl.conf add

4) Mount it!
 mount_psshfs -O IdentityFile=/home/earthling/.ssh/mercury_rsa mercurius@ /home/earthling/mnt/remote_to_mercury



mount_psshfs: handshake failed, server does not support sftp?
mount_psshfs: puffs_mount: cannot open /dev/putter
mount_psshfs: puffs_daemon: Permission denied
mount_psshfs: puffs_mount: Permission denied
mount_psshfs: puffs_mount: Operation not permitted


UNIX notes

grep -v “^$” filename > newfilename

lsof -P -i -n

tcpdump -i eth0 host

netstat -t -u -c

hdparm -t /dev/sda
Test hard disk reading speed

echo “foo” > /dev/tcp/
send echo to socket network

awk ‘length>72’ file
list of lines that are longer than 72 characters

sudo mknod /dev/ttyS4 c 4 68
Add another tty device using mknod command

find ~ -name ‘*.mp4’ | xargs mplayer
play all mp4 files on home directory

a2ps –line-number=5 message.rb

stop process using bash ^Z
[2]+ Stopped
you can view these processes with $jobs
then you can refer them to %2
e.g. $kill %2
$bg %2
$fg %2

find . -name '*.txt' | xargs perl -pi -e 's/old_str/new_str/g'

~/jruby/bin/jruby -J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=4000 -J-Xdebug dioneas.rb ../sample/ruby/philosophers.rb

find ./ -type d -name .svn -exec rm -fr {} +

rm !(b)…..removes all file but b

#disable ipv6
#sysctl -w
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6


gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -dNumRenderingThreads=3 -sOutputFile=output.pdf input.pdf
-dNOGC — NO garbage collection
-c “30000000 setvmthreshold” –30MB of RAM
-dPDFSETTINGS=/screen (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook (low quality, 150 dpi images)
-dPDFSETTINGS=/printer (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default (almost identical to /screen)

pdftk sales_report.pdf output SalesReport.pdf user_pw PROMPT

echo “test” | ssh user@ ‘cat > file’


patch -p0 -i ~/fix.diff

sed -n 5647,6239p app.log > relevant.log

python -m SimpleHTTPServer 8000

(server)$ cat | nc -l 8888
(client)$ nc <server> 8888 >

WGET Error `http://:8080/’: Invalid host name SOLVED

Some days a go i tried to use wget to download some files from internet, and I alway got the error `http://:8080/': Invalid host name, I read the man page but I couldn’t find anything that help me to solve the problem, then I searched in internet but anything again. So I used Opera to download the files, but I was not quite trying to know the strange behavior of wget but I leaf it in peace.

And now while I was testing a c program which uses extern char **environ I saw environ[10]: http_proxy=http://:8080/, I thought I had the answer to the strange behavior of wget, and I was right.

To solve it do
$ unset http_proxy

And in gnome look at System->preferences->Internet->proxy

Gnome proxy
Be sure to your proxy is well configured or choose direct connection