Getting rid of the dreaded “Write failed: Broken pipe”.
Note the difference of ServerAliveInterval/ServerAliveCountMax and ClientAliveInterval/ClientAliveCountMax.
For Mac, Linux and CygWin: Read the rest of this entry »
Posted by jpluimers on 2014/01/25
Getting rid of the dreaded “Write failed: Broken pipe”.
Note the difference of ServerAliveInterval/ServerAliveCountMax and ClientAliveInterval/ClientAliveCountMax.
For Mac, Linux and CygWin: Read the rest of this entry »
Posted in *nix, Apple, Cygwin, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2014/01/25
In case you want to inspect any of your aliases.db files, use praliases: the reverse of makemap to get an aliases text file.
Plus you don’t have to remember the makemap options.
Use the -f option to dump a specific db file:
snap:/etc/mail # praliases -f /etc/aliases.db
–jeroen
Posted in *nix, Linux, Power User, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2014/01/23
I wish I had found about Generate HTML Tables Clean and Fast years ago.
Every once in a while I want to generate the source code for an HTML table with some content easily.
I’ve found no tool doing this in an easy manner and starts in a split second.
But the web page Generate HTML Tables Clean and Fast does.
Correction: did. It is now off-line, but the Blended Technologies » Blog Archive blog posts about it are still online: Introducing TableGen – The HTML Table Generator and Tablegen Goes Open Source, as is the WayBack machine archive for it.
So I installed Python on my openSUSE server according to Embedding Python In Apache2 With mod_python (… OpenSUSE) | HowtoForge, (could as well have configured in httpd.conf in stead of python.conf: no difference between installing mod_python via httpd.conf and conf.d in apache) then installed the TableGen source there.
(Note: more python.conf examples)
That would still have Python generate a 404 error (uncool: a python generated 404 error does not leave a log of the cause anywhere), not because the index.py was absent, but because it was written in old style “print” statements, not using the new style def index(req); way (thanks Senthil Kumaran, and AJ. for your answer).
So I did some research (this was my first encounter with Python) at for instance Paul Osman : Introduction to mod_python, then rewrote the print parts of the script into string concatenations, then return the full HTML.
(Note: if there is a
print "Content-Type: text/html"(for instance demonstrated in Hello World | Web Python), you can omit it, or set the req.content_type likereq.content_type = 'text/html'which usually is determined automatically by Python).That caused quite a few IndentationError: expected an indented block quote errors: python is indentation sensitive (I hadn’t used a language depending on that for ages), and gives a confusing error when you have a colon (:) followed by an unindented docstring: Python: I’m getting an ‘indented block’ error on the last 3 quotes (“””).
Then it still didn’t completely work: the form parameters would not be obtained correctly, so I read further, found 3.1 A Quick Start with the Publisher Handler and started to fix that too. That took way too long, so I found out that “mod_python” is not very much maintained any more and “mod_wsgi” is the way to go.
So I disabled the “python” module in YaST2, removed “/etc/apache2/conf.d/python.conf”, then installed the “apache2-mod_wsgi” software package in YaST2, then added the “wsgi” module to HTTP Server Configuration list of Server Modules (it automatically gets enabled) and saved the configuration.
These steps modified the APACHE_MODULES in /etc/sysconfig/apache2, restarted apache with “rcapache2 restart”. You can verify with “httpd2 -M” which modules are loaded. The list should exclude “python_module (shared)” and includes “wsgi_module (shared)”.
Most of this is described in has anyone gotten mod_wsgi working.
Python is whitespace sensitive, but you can have multiple statements on one line. That’s why Python allows semicolons after each statement.
Read Setting up Python with WSGI on Apache for a directory – Stack Overflow.
Read PyCon Conference Slides – Sydney 2010 – Python WSGI adapter module for Apache.
Read Graham Dumpleton: Why are you using embedded mode of mod_wsgi?.
Read Serving Python scripts with Apache mod_wsgi, part I | Leave No Bit Unturned.
Read Parsing the Request – Get | Web Python.
Watch WSGI Tutorial. It explains a lot, including Accessing POST Data from WSGI.
Error “Attempt to invoke directory as WSGI application” -> you cannot do that, there is no way to map a directory to an “index.py” in that directory.
For importing .py files from the same directory as your main .py file:
import os import sys directory = os.path.dirname(__file__) sys.path.insert(0, directory) from webutils import *Start using The Web framework for perfectionists with deadlines | Django.
A few really cool things about this page:
Generating something like this was a breeze: Read the rest of this entry »
Posted in *nix, Apache2, Development, HTML, Linux, openSuSE, Power User, Software Development, SuSE Linux, Tumbleweed, Web Development | Leave a Comment »
Posted by jpluimers on 2014/01/10
I usually used netstat with some grep filter for this, but Brandon Titus showed at StackOverflow that the lsof command is much easier to use:
lsof command should be able to do this just fine. Just use this:
lsof -i :<port_number>
lsof -i udp:<port_number>
lsof -i tcp:<port_number>and all of the processes should come up.
The lsof commands work on SUSE, Max OS X, CygWin and many other environments.
(update 20160304: added more arguments and links)
Two other commands I use often:
netstat -tulpn | sort
(for connected and listening tcp/udp ports it shows processes and port numbers; see the netstat parameters for more details, note that -u includes udp and -l adds listening sockets)
rpcinfo -p ; rpcinfo -s
(shows the ports used by rpcbind)
Note that one day I’ll learn the iproute2 equivalents (many of which have non descriptive 2 letter names like ip, iw, ss, tc, maybe because iproute2), but as OS X still doesn’t have iproute2, I’m hesitating. Anyway, that day:
–jeroen
via
Posted in *nix, Apple, Cygwin, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, OS X 10.8 Mountain Lion, Power User, SuSE Linux | 1 Comment »
Posted by jpluimers on 2014/01/06
When configuring a fresh SUSE machine, I forgot one tiny detail resulting in Sendmail ok on 127.0.0.1 but not ip address.
Solution:
Please change in
/etc/sysconfig/mailfromSMTPD_LISTEN_REMOTE="no"to
SMTPD_LISTEN_REMOTE="yes"then run
SuSEconfigand
rcsendmail restart
–jeroen
Posted in *nix, Linux, openSuSE, Power User, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2014/01/02
Very interesting, especially since rdesktop.org works with Windows Server 2008 R2 and Windows 7 as well, and is stable on x64.
It provides three tools: rdesktop, rdpproxy and seamlessrdp.
Researching this, I also found about TSWindowClipper which allows you to seamlessly integrates remote apps on your client by integrating a DLL inside the MSTSC software using the official virtual channels.
Back to rdesktop: I really wish the documentation was better, but it contains some very interesting source code.
rdesktop is an open source client for Windows Remote Desktop Services, capable of natively speaking Remote Desktop Protocol (RDP) in order to present the user’s Windows desktop. rdesktop is known to work with Windows versions such as NT 4 Terminal Server, 2000, XP, 2003, 2003 R2, Vista, 2008, 7, and 2008 R2.
rdesktop currently runs on most UNIX based platforms with the X Window System, and other ports should be fairly straightforward.
rdesktop is released under the GNU Public Licence (GPL), version 3. Please send feedback, bug reports and patches to the appropriate mailing list. Patches can also be submitted to the SF patch tracker.
rdesktop is a project. See the Sourceforge rdesktop project info and the Wiki for more information.
Status
The latest stable version of rdesktop is 1.7.1 (edit: this was at the time of writing, for the current latest, check here). This versions solves major issues with 64bit version and smartcard support among a few minor fixes.
–jeroen
Posted in *nix, Development, Linux, Power User, Remote Desktop Protocol/MSTSC/Terminal Services, Software Development, SuSE Linux, Windows, Windows 7, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »
Posted by jpluimers on 2013/12/24
I’ve been wanting this a very long time, so I’m going to install it Right Now ™ (:
Right before X-Mas, Scooter Software did the ANN: Beyond Compare 4.0 beta available on Windows, Linux, and OS X:
Posted: Dec 23, 2013 4:17 PM
Beyond Compare 4.0 beta is now available for testing on Windows, Linux, and OS X.
http://www.scootersoftware.com/beta
This version adds a number of new features: Read the rest of this entry »
Posted in *nix, Apple, Beyond Compare, Delphi, Development, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, Power User, Software Development, Source Code Management, SuSE Linux, Windows | Leave a Comment »
Posted by jpluimers on 2013/12/16
Thanks DevShed:
ls -l –time-style=full-iso
Emits full ISO 8601 time stamps and it works on:
–jeroen
Posted in *nix, Cygwin, Linux, Power User, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2013/12/06
Like forgetting about the tar syntax, I usually forget which is the left parameter in an ln command (the file or link? it is the file!)
Thanks [WayBack] cyberciti.biz:
There are two types of links
- symbolic links: Refer to a symbolic path indicating the abstract location of another file
- hard links : Refer to the specific location of physical data.
To create a symbolic link in Unix or Linux, at the shell prompt, enter the following command:
ln -s {target-filename} {symbolic-filename}
–jeroen
Posted in *nix, Cygwin, Endian, Linux, Power User, SuSE Linux | 2 Comments »
Posted by jpluimers on 2013/09/09
A while ago, I had to transfer a couple of files from a Linux machine where I did have console access, but no proper network access.
This was the sequence to get it connected and copy a directory to the USB flash drive:
# fdisk -lDisk /dev/sdd: 8019 MB, 8019509248 bytes
20 heads, 16 sectors/track, 48947 cylinders
Units = cylinders of 320 * 512 = 163840 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 * 1 48948 7831512 b Win95 FAT32/mnt/USB directory to mount the device to using the mkdir command:# mkdir /mnt/USBmodprobe command to make sure the vfat file system support is loaded:# modprobe vfatmount command to mount the device from the first step (/dev/sdd1) to the directory you created (/mnt/USB)# mount /dev/sdd1 /mnt/USBrsync command to recursively (-p) copy a directory maintaining timestamps (-t) and showing progress (-v)# rsync -rtv /home/user/directory/ /mnt/USB/directory/umount command to unmount the directory (and therefore the device)# umount /mnt/USB–jeroen
Posted in *nix, Linux, Power User, SuSE Linux | Leave a Comment »