Accessing a VPN (PPTP) via the command line
Grok Headline matches for Accessing a VPN (PPTP) via the command line
Command Line PHP
Command Line PHP
12/20/2002 10:51 AMCommand Line PHP
Since I was doing this yesterday, I appreciated this pointer from
Keith (who also helpfully has links to Lord of the Rings Reviews)
[_Go_]
Abusing the command line
Abusing the command line
04/09/2004 04:08 PMIf you're running OS X, try this:
say -v Kathy `curl --silent
http://api.technorati.com/getinfo?username=simonwillison | grep
'<inbound' | sed -e 's/ <//' | sed -e
's/inboundblogs>/Simons blog has /' | sed -e
's/<\/inboundblogs>/ inbound blogs and /' | sed -e
's/inboundlinks>//' | sed -e 's/<\/inboundlinks>/ inbound
links/'`
Your computer should read out to you my Technorati inbound blogs
and inbound links, extracted from the Technorati web API. Parsing
XML using sed is
a nasty trick I picked up from this O'Reilly article;
speaking the output of a command using the 'say' and the backtick
shell operator was my moment of inspiration for the day.
Pizza From the Command Line
Pizza From the Command Line
05/07/2004 07:14 PMCommand line blacklisting
Command line blacklisting
09/09/2004 01:15 AMJust over a year ago, I started blacklisting domain
names from links featured in comment spam. My idea then was that these
blacklists could become a shared resource: people would publish their
own blacklist and subscribe to those of people they trust, thus making
it much harder for spammers to operate. While the sheer volume of spam
domains meant that the technique was much less useful than I
originally anticipated, I've continued to maintain my blacklist ever
since as a preventative measure against repeat spammers.
I have a confession to make: all of my blog administration
(with the exception of adding entries and blogmarks) is performed
using phpMyAdmin. The trouble
with writing your own software is that it's very easy to skimp on the
backend tools, since you're the only person who will ever see them.
Incidentally, this is the main reason I plan to switch to WordPress just as soon as I find the
inspiration to write the necessary import scripts. Comments are
deleted in phpMyAdmin, and domains are blacklisted by manually editing
the blacklist.txt
file via FTP.
This has been really bugging me, especially since I have
so little other use for FTP that my only installed client is an
unregistered version of Transmit (closes after ten
minutes, won't save passwords along with account details). I've been
muddling along with that for longer than I care to admit, but today I
decided to take 10 minutes out to solve the problem once and for all.
I could have put together a web interface for adding new domains but I
wasn't really in the mood, so I decided to put time spent reading The Art of Unix
Programming to good use and knock out a simple command line
application.
The result (minus my login details) can be found here. Sample usage: ./blacklist.py
www.domain.org www.domain2.com. It follows the Unix ideal of
being the simplest-thing-that-could-possibly-work, and ended up taking
longer to write than I expected thanks mainly to the craziness of
Python's ftplib
. I've seen complaints about this before, and it thoroughly
deserves its bad reputation.
Here's one example: retrlines is the method
used to retrieve ascii text from the server. Bizzarely, it doesn't
actually return the text receieved; instead, it expects you to provide
it with a callback function that will be fed each line in turn, minus
the newline. Sounds like a job for Stri
ngIO, but StringIO objects don'y have a writeline
method (required to add the newline back on). I ended up writing my
own extension of the StringIO2 class and adding a
writeline method just to preserve the newlines returned from the
server!
Strange APIs aside, I'm pretty pleased with the final
result. It follows a bunch of Unix design patterns (and skips others
such as those related to configuration, but I'm not overly bothered
about those) including the following:
- A usage note is displayed if no arguments are provided.
- Multiple domains can be blacklisted at once, by providing them as
multiple command line arguments.
- Domains that are already in the blacklist are skipped, and a
message is written to standard error.
- If the script suceeds, it doesn't say anything at all.
It also uses the common Python idiom of wrapping the
principle logic in a function and then calling that from a block that
runs only if the file is executed directly (the __name__ ==
'__main__' idiom) so that other Python code can import the
module and reuse its functionality if required.
There's plenty of room for improvement: being able to pipe
a list of domains in via standard input would be nice, and hard coding
the (unencrypted) username and password is sloppy (as is expecting the
blacklist.txt file to live in the FTP home directory). Even better, with SSH access the whole thing could be
replaced with an infinitely more secure one-liner: echo www.domain-to-ban.org | ssh username@server "cat -
>> blacklist.txt". I'm happy though: an irritating task has
become much less irritating and I have some example code to fall back
on next time I need to get mucky with ftplib.
A command line ogg to mp3 converter
A command line ogg to mp3 converter
08/09/2004 11:34 AMUsing the same paradigm as ChrisR's flac to mp3 command line script,
I've done the same to convert ogg files to mp3s using command line
tools.
You'll need to download and compile the vorbis player/encoder tools
for everyone ...
ISU Command Line Syntax
ISU Command Line Syntax
07/26/2004 03:52 AMPHP Command Line Module
PHP Command Line Module
06/04/2004 10:43 AMPEAR Console
Classes: Here's a tutorial on a fascinating little PEAR module
that facilitates using PHP from the command line. It has methods for
rendering tables, displaying progress bars, and doing color formatting
on ANSI compliant terminals, this giving you some flexibility when
developing PHP command line apps. Fascinating what these guys come up
with.
Click here to comment on this entry
The Command Line Is Your Friend
The Command Line Is Your Friend
03/06/2004 01:56 AMIf you're in the tech field, it might behoove you to know your
command line utilities, and to have a copy of Cygwin handy if you run Windows.
There are reasons why those old-school UNIX guys look down their long
beards at the rest of us with disdain for not knowing the system
shell. I ran across a great use of command line tools today that I
thought I'd share.
Continue reading "The Command Line Is Your Friend"
Click here to comment on this entry
PHP on the Command Line - Part 2
PHP on the Command Line - Part 2
08/11/2004 07:01 PMTake your knowledge of the command line interface a step further with
Harry's PHP-centric series. Part 2 shows how you can hook up a command
line PHP script with existing command line tools provided by your
operating system.
Mac OS X command line tab completion
Mac OS X command line tab completion
09/23/2004 03:00 AMTech-Recipes Sep 23 2004 5:45AM GMT
SitePoint: PHP on the Command Line (Pt.
1)
SitePoint: PHP on the Command Line (Pt.
1)
06/16/2004 08:26 AMA new article has been posted over on
SitePoint.com from Harry Fuecks
covering the first part of a series on
PHP on the
Command Line.
Command Line Progress Bar 1.09
Command Line Progress Bar 1.09
06/01/2004 10:34 AMA simple command line tool to display information about a data
transfer stream.
PHP on the Command Line - Part 1
PHP on the Command Line - Part 1
06/16/2004 07:29 PMRoutine administration of your PHP Website is easily achieved via
PHP's CLI, or command line interface. In the first instalment of his
two-part series, Harry looks at the fundamentals of working with the
PHP command line.
Command-Line Accountant 0.11
Command-Line Accountant 0.11
12/21/2003 04:45 PMA command-line personal finance utility.
Command Line Timeclock 0.2-r2
Command Line Timeclock 0.2-r2
06/13/2004 09:25 PMA command line timesheet application.
MSI FAQ: Command-line for SMS
Distribution
MSI FAQ: Command-line for SMS
Distribution
06/24/2004 11:31 AMISU Command-Line Switches
ISU Command-Line Switches
01/01/2005 10:21 AMCommand Line Accountant
Command Line Accountant
12/09/2003 12:22 AMVersion 0.1 has been released
Command-Line Accountant 0.2
Command-Line Accountant 0.2
02/17/2004 05:39 AMA command-line personal finance utility.
Command Line Progress Bar 1.04
Command Line Progress Bar 1.04
10/31/2003 05:11 PMA simple command line tool to display information about a data
transfer stream.
SitePoint: PHP on the Command Line (Pt.
2)
SitePoint: PHP on the Command Line (Pt.
2)
08/11/2004 08:33 AMNew on
SitePoint today, there's
a new posting from
Harry
Fuecks in a continuation of his "PHP on the Command Line" series -
Part
2.
10.3: Fax from command line (or
AppleScript)
10.3: Fax from command line (or
AppleScript)
12/05/2003 11:21 AMI was working on this to be able to fax from Filemaker with FM
scripting and AppleScripting. I needed to print to a file (a .ps
file), then send the resulting file to the fax. Fax is actually a CUPS
print queue, and I just ne...
Building MSI command line
Building MSI command line
01/19/2004 12:34 AMCommand Line Timeclock 0.2
Command Line Timeclock 0.2
06/07/2004 09:17 AMA command line timesheet application.
SMS Command Line Script
SMS Command Line Script
12/28/2004 11:27 PMAdd login items via the command line
Add login items via the command line
03/22/2005 03:39 PMThis is simple but handy command to add LoginItems (items that are
executed after the user logs in) via the command line using the
default tool. To add a normal startup item, use this syntax:
defaults write loginwindow AutoL...
SqlCli (SQL Command Line Interpreter)
SqlCli (SQL Command Line Interpreter)
08/03/2004 07:44 PMSqlCli 1.0-beta-1 released
ProNet: XSH: Command-line XML shell
ProNet: XSH: Command-line XML shell
03/24/2005 05:21 AMIf you're Perl-fluent amd looking for a cool little tool to work with
XML data, check out the XSH command-line interface. As described in
this DevX article: Enter XSH, an open source command-line XML shell
that lets you interactively query...
Command-line pizza-orderator
Command-line pizza-orderator
05/07/2004 03:35 AMpizza_party is an open-source command-line app for ordering pizzas
from Domino's.
pizza_party [-o|--onions] [-g|--green-peppers] [-m|--mushrooms]
[-v|--olives] [-t|--tomatoes] [-h|--pineapple] [-x|--extra-cheese]
[-d|--cheddar-cheese] [-p|--pepperoni] [-s|--sausage] [-w|--ham]
[-b|--bacon] [-e|--ground-beef] [-c|--grilled-chicken]
[-z|--anchovies] [-u|--extra-sauce] [-U|--user= username]
[-P|--password= pasword] [-I|--input-file= input-file] [-V|--verbose]
[-Q|--quiet] [-F|--force] [QUANTITY] [SIZE] [CRUST]
* Can order pizza with only a few keystrokes.
* Can save pizza preferences.
* Can use batch files for ordering many pizzas.
* Has easy to use flags for ordering different toppings.
* Runs on most UNIX-like operating systems.
* Supports most currently popular topings like "mushrooms", and
"pepperoni"!
* Unattended / background operation.
* Pizza Party is distributed under the GNU General Public License.
Link
(
via Kottke)
PowerArchiver Command Line Support
Add-On v3.51
PowerArchiver Command Line Support
Add-On v3.51
06/30/2004 05:48 PMPowerArchiver Command Line Support Add-On is a free cosole utility for
Windows which includes full built-in support for creating ZIP, CAB,
LHA (LZH), BH and JAR archives, as well as extracting ZIP, RAR, ARJ,
ACE, CAB, LHA (LZH), TAR, GZIP, BH, ZOO, ARC, JAR, XXE and UUE
archives. [Freeware 1.15 MB]
Command Line Options for Virtual PC.exe
Command Line Options for Virtual PC.exe
02/15/2004 09:28 AM10.3: Turn fax services on and off from
the command Line
10.3: Turn fax services on and off from
the command Line
01/22/2004 02:36 AMFaxing is a cool feature on OS X, but few people purchase a separate
phone line for a fax machine at home. So, if you want to receive a
fax during the day on your home Mac, then legitimate callers will get
the fax tone rathe...
Command line Futurama quotes
Command line Futurama quotes
02/10/2004 02:44 AMToday's command line amusement:
lynx -mime_header http://slashdot.org/ | head -n 6 | tail
-1
Perl Command-Line Options
Perl Command-Line Options
08/10/2004 06:02 PMAfter looking at special variables, Dave Cross now casts his eye over
the impressive range of functionality available from simple
command-line options to the Perl interpreter.
InstallShield: Compiling at the Command
Line
InstallShield: Compiling at the Command
Line
06/10/2004 04:48 AMTemplatized C++ Command Line Parser
0.9.9
Templatized C++ Command Line Parser
0.9.9
08/11/2004 01:58 PMA simple library for parsing commandline arguments.
In The Beginning Was The Command Line,
Updated
In The Beginning Was The Command Line,
Updated
01/05/2005 08:43 AMQuit applications from the command line
Quit applications from the command line
06/25/2004 10:25 AMThe recent hint to “Extend the power of 'open -a'” inspired me to
write this quick hack to quit an application:
#!/bin/sh
echo | osascript <<EOF
tell application "$*"
quit
end tell
EOF
Call it quit, save it in ...
Synchronize the iDisk from the command
line
Synchronize the iDisk from the command
line
06/25/2004 10:25 AMI've been experimenting alot with Perl lately, and was looking for a
way to synchronize my iDisk via the command line, or with an
AppleScript. I scoured the web for such a technique, but to no avail.
I knew that the MirrorA...
Grok Description matches for Accessing a VPN (PPTP) via the command line
GrokA matches for Accessing a VPN (PPTP) via the command line
10.3: Split routing with PPTP in Panther
10.3: Split routing with PPTP in Panther
01/22/2004 02:37 AMI periodically need to use PPTP to access my systems inside a firwall,
but want the rest of my traffic to go through my normal default route.
To do this, i need to invoke pppd with the "nodefaultroute" option and
have an ip-u...
PPTP is Dead, Too
PPTP is Dead, Too
12/22/2004 01:27 AM Microsoft's VPN protocol PPTP is now dead, too: It's been known for a
while that MSCHAPv2 authentication was a bad idea, and PPTP
(Point-to-Point Tunneling Protocol) relies by default on this method
of credentials. George Ou explains how Joshua Wright, developer of the
Cisco LEAP breaking software Asleap has simply added PPTP breaking to
the mix. Both protocols are weak enough that a weak key choice--short
and found in a dictionary with some variation--can be broken by
iterating through a very large database of precomputed password hashes
that a cracker has put together in advance. They don't have to crack
the authentication process, just grab the transaction and run it on
their own computer against their hashes at a rate of 45 million
passwords per second on a normal desktop computer, Ou writes. Laptops
would be slightly slower. Ou notes that he thought LEAP and PPTP had
similar weaknesses, and Wright's update--made only after contacting
Microsoft and being quite decidedly rebuffed over his concern--shows
he was correct. Long, complex, user-managed passwords can still
protect PPTP because this is a brute-force attack. You can also switch
to using EAP-TLS for the credential exchange in PPTP, but that then
requires corporate public-key infrastructure. WPA has a similar
problem with weak passwords but it's tied to an SSID. So you can't
precompute generally for passwords as with the LEAP and PPTP weakness,
but you could precompute passwords against common SSIDs, like linksys.
Assuming, as wardrivers have discovered, that the vast majority of
base stations have a default SSID, this makes it a little simpler, but
not trivial. Likewise, only weak WPA passwords can be broken, so
you're stuck for people who throw in a couple of exclamation points.
I'm just testing Buffalo's new VPN (PPTP) router, and discovered that
they set the default SSID to the MAC address of the unit, which,
although ugly looking in a list of available networks, would defeat a
precomputed default SSID password database. (Thanks to Robert
Moskowitz for a prod to clarify this.) When I say a security protocol
is dead, I don't mean that it's actually impossible to use. It's just
that you can no longer use it with any degree of assurance that the
purpose for which it was intended can be fulfilled. It's like driving
a car with a cracked windshield. It keeps the bugs off, but it's not
really safe to drive...
Frickin PPTP Proxy 0.9b
Frickin PPTP Proxy 0.9b
09/27/2004 10:57 AMA PPTP proxy for OpenBSD and FreeBSD.
Simple command-line editor of images
Simple command-line editor of images
09/04/2004 12:02 PMPRE-ALPHA
Possible PPTP Flaw Could Leave VPNs Open
Possible PPTP Flaw Could Leave VPNs Open
09/30/2002 01:52 PMSet no default route for VPN Client via
PPTP/L2TP
Set no default route for VPN Client via
PPTP/L2TP
06/17/2005 04:40 PMIt seems to be a common problem that, when connecting with Mac OS X
VPN client to a VPN server, you end up with getting a default route to
that server. But in some cases, you'll still want to use your original
internet connec...
Java command line option parsing suite
Java command line option parsing suite
04/12/2005 11:54 AMJArgs 1.0 Released
Windows XP Command-Line Reference: Chcp
Windows XP Command-Line Reference: Chcp
09/23/2004 05:52 PMRip MP3 and windows media streams from
the command line
Rip MP3 and windows media streams from
the command line
12/05/2003 11:20 AMI was kinda bummed that I had to use Windows to save audio/video
streams to disk with StreamBox VCR. I wanted an app to use on my Mac
to do this. People suggested stuff like WireTap which simply hijacks
the system's sound bef...
New Command Line Tools in Windows Server
2003
New Command Line Tools in Windows Server
2003
06/07/2004 10:45 AMXP: kill a Windows process from the
command line with taskkill
XP: kill a Windows process from the
command line with taskkill
04/26/2004 09:42 PMTech-Recipes Apr 27 2004 1:31AM GMT
XP Pro: List active Windows programs
from command line with tasklist
XP Pro: List active Windows programs
from command line with tasklist
05/02/2004 03:07 AMTech-Recipes May 2 2004 6:24AM GMT
Command-Line Switches For Windows
Software Update Packages
Command-Line Switches For Windows
Software Update Packages
02/17/2004 10:32 AMMicrosoft Office Command Line Switches
Microsoft Office Command Line Switches
06/17/2004 06:16 PMNew Command Line Tools in Windows Server
2003 - Today's Tool: CMDKEY.EXE
New Command Line Tools in Windows Server
2003 - Today's Tool: CMDKEY.EXE
09/09/2004 01:33 AMNew Command Line Tools in Windows Server
2003 - Today's Tool: DEFRAG.EXE
New Command Line Tools in Windows Server
2003 - Today's Tool: DEFRAG.EXE
07/27/2004 07:50 PMNew Command Line Tools in Windows Server
2003 - Today's Tool: DSADD.EXE
New Command Line Tools in Windows Server
2003 - Today's Tool: DSADD.EXE
08/30/2004 01:35 PMNew Command Line Tools in Windows Server
2003 – Today's Tool: EVENTCOMBMT
New Command Line Tools in Windows Server
2003 – Today's Tool: EVENTCOMBMT
06/05/2004 10:30 AMUpdate: Wanted Unix Command Line Binary
to Convert Windows Icon Files to PNG
Update: Wanted Unix Command Line Binary
to Convert Windows Icon Files to PNG
03/13/2003 11:29 AMUpdate: Wanted Unix Command Line Binary to Convert Windows Icon
Files to PNG
The title really says it all. Either this means something to
you or it doesn't. It must handle 24 bit icon files. Example
File. Any thoughts?
Note: if this means nothing to you then no worry.
More in a bit.
Microsoft SQL Server 7.0 administrative
command line utilities PART5
Microsoft SQL Server 7.0 administrative
command line utilities PART5
07/03/2004 09:26 PMMicrosoft SQL Server 2000 command line
utilities (Part 2)
Microsoft SQL Server 2000 command line
utilities (Part 2)
02/15/2004 09:28 AMMicrosoft SQL Server 7.0 administrative
command line utilities PART4
Microsoft SQL Server 7.0 administrative
command line utilities PART4
06/02/2004 06:17 PMMicrosoft SQL Server 7.0 administrative
command line utilities PART3
Microsoft SQL Server 7.0 administrative
command line utilities PART3
12/30/2003 12:03 AMThe Windows Installer Software
Development Kit Command Line Merge and
Install Tools - Part two Msitran.exe
The Windows Installer Software
Development Kit Command Line Merge and
Install Tools - Part two Msitran.exe
09/12/2004 10:55 AM Accessing a VPN (PPTP) via the command line