topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 19, 2019, 01:16 AM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Gothi[c] [ switch to compact view ]

Pages: [1] 2next
1
Living Room / Reviving an old luggable computer
« on: December 17, 2018, 04:35 PM »
Some years ago, when visiting the midwest vintage computing festival I picked up a Panasonic Sr. Partner luggable 8088 computer from someone's cheap "as-is" pile. I figured if it wasn't working it would be a fun project to try and restore it.

panasonicsrparner.jpg

It's really kind of neat, it has a built-in thermal printer on top.

Sure enough, when I brought it home, I was slightly disappointed, although not surprised, that after switching it on, nothing appeared on the screen.
The light for one of the floppy drives remained on solid, and the screen remained dark.
I could hear a fan running, but no high-pitched whine from the little CRT screen, which is what you would expect if it had power going to the flyback.

At least a year later (or was it two?), and after moving, I finally got around to trying to fix it (first round) - I started with taking the entire thing apart, and trying to get the screen out, which ended up being rather tricky. This thing is built like a giant puzzle-tank.

panasonic_open1.jpg

panasonic_open2.jpg

When I finally got the video input going to the monitor hooked up to a scope, I was pleased to find what looked like a TTL signal, so not completely dead logic-wise. So, my attention went to focusing on the power to the CRT monitor. After inspecting the PCB and not finding anything visually wrong, and poking and prodding at it for quite some time with it powered (dangerous! don't do this without proper precautions!) I was just ready to give up, when I accidentally bump one of the flyback caps and sure enough I briefly heard the high-pitch whine of a flyback powering on. I proceeded with poking each of the caps with a long plastic screwdriver (the kind you use for adjusting variable coils) and I eventually found the one I bumped, and found that when I held it in place, the display would turn on. This was the first time I saw a blinking cursor! After pulling power, draining caps and anode, I re-soldered the cap, and the crt was back from the dead!

A kind friend had gifted me some ancient floppies with various versions of MS DOS to try with this thing, so I inserted one of them, powered it on, nothing. blinking cursor, and drive with solid red light.
After trying all the disks I had on hand, disappointed once again, I gave up for several months.

Eventually I got back to it, and concluded that the floppy drive was probably not working right. I figured I would try swapping the A and B drive, maybe the other one was good. Then I notice the B drive did not have the molex power connector hooked up. Didn't think nothing of it.
Swapped the drives, powered them both on. Now the computer won't even show the cursor! What's going on! After some trial and error:

* both floppies disconnected: have cursor, after some time 'boot error' (was excited to see text for the first time!)
* Only drive A connected: solid power light
* Both drives connected: no cursor.
* Only drive B connected: no cursor.
* Using drive B as drive A: no cursor.

I eventually concluded drive B was defective. It was the only option, because any time it's connected to power, the machine would be dead.
I noticed it would even behave this way when I only connect power, and not the data cable, so I immediately start measuring the pins on the molex connector, and sure enough, there is a short!

<months pass again with the machine disassembled on the workbench>

After disassembling the broken floppy drive next round, I managed to disconnect the smaller pcb on the back with the molex and data connector, with everything disconnected but the small pcb, i'm still measuring a short - this is good news! that means the problem is in the smaller (less complicated pcb).

Near the molex power connector I see 3 capacitors, 2 elco's and one ceramic. I figured that a bad capacitor there could definitively be causing this short - visually they look fine though. In absence of anything else to try, i start with desoldering the ceramic cap (as it was the easiest to get to) - still shorting out. Disappointment again.

<months pass again with the machine disassembled on the workbench>

Today I had off of work and finally decided to have another go at this! I desoldered the other 2 capacitors, and sure enough, no more short!
I replaced the ceramic cap I desoldered earlier with a spare. I didn't have a replacement for the 2 elco's (there was one on the 12V and one on the 5V pin) - i figured they are probably just to remove ripples in the supplied power, and decided to try without them.

In the end my persistence was rewarded! I finally got the machine to boot, and both drives are now functional! I eventually found a bootable dos floppy. It was very confused about the current date, as if I'm an alien from the future. It was clear no one in 2019 was ever intended to use this machine!

dosdate.jpg

I tried putting in a floppy in the second drive, and sure enough, both work!

bothfloppies.jpg

compaqdos.jpg

Time to fire up GWBASIC (which I found on one of the donated floppies!) and go to town!

2
Non-Windows Software / The comprehensive IRIX audio software list
« on: August 30, 2013, 10:44 AM »
Many old IRIX workstations still make a pretty decent audio workstation today.

The SGI Octane for example, has a mere 3ms audio input-to-output latency out of the box, and they come with Alesis ADAT 8-channel, 24-bit optical ports are built-in, along with S/PDIF or AES/EBU optical and coaxial ports.

On top of that, there is quite a big list of audio software for the platform out there, many of it still relevant and very usable today. By default Irix comes with a pretty decent mutitrack recording program. Hunting down all the Irix audio software is a bit tricky. Whomever said nothing ever gets deleted from the internet obviously never has researched old obscure stuff :)

There's a list on sgi's old ftp that's rotting away. It is ridden with broken links and it's own pages don't even link to one another correctly anymore, and I have a feeling one of these days it's going to just vanish completely as SGI/rackable is dropping it's legacy IRIX support this year.

So I started copying the list and reformatting it on the reddit /r/IRIX subreddit wiki:

http://www.reddit.co.../wiki/audio_software

There's some pretty fascinating software in that list.

3
Non-Windows Software / Screenshot thread!
« on: August 30, 2013, 10:22 AM »
So, here's a thread to kick off this new section. Post your OS screenshots! Use GNU+Linux, HP-UX, Plan9, z/OS, GCOS, MCP, *BSD, anything else? Share what it looks like! :)
Here's my humble contribution:

SGI IRIX:

Fresh install on an Indigo2:

irix_3.png

Screenshots from my octane:

irix_2.png

irix_1.png

GNU+Linux:

4DWM running on GNU+Linux through X11 forwarding over SSH:

linux_4dwm.png

Fluxbox window manager on GNU+Linux:

fluxbox_2.png

Solaris:

Fresh install of Solaris 10 booted in CDE:

solaris_1.png

After some time messing with it, this is what it looks like now:

solaris_2.png

4
Living Room / Products designed to fail, a documentary
« on: November 01, 2011, 07:29 PM »
In case you need yet another thing to piss you off in this world,
Here's an interesting documentary I found that confirms what I always suspected: how nowadays products are designed to fail from the start...

http://documentaryhe...ightbulb-conspiracy/


5
blowssi is a an irssi cryptography script.

Download from official web page: http://linkerror.com/blowssi.cgi

Key features:
  • Compatible with mircryption and FiSH.
  • Supports both cbc and ecb encryption modes. (to use cbc encryption just prefix the key with cbc: )
  • Blowssi is Free (both as in freedom and as in beer) software (licensed under the GNU GPL v3)
  • Blowssi will work on any platform perl and irssi work on.
  • dh1080 key exchange (since 0.2.0)

Requirements:
  • perl (...duh)
  • Crypt::ircBlowfish (see bundeled zip file, but also available from donationcoder.com)
  • Crypt::ircDH1080 (see bundled tar.gz file)
  • Crypt::CBC (on gentoo you can just: emerge dev-perl/crypt-cbc)
  • MIME:Base64 (on gentoo you can just: emerge perl-MIME-Base64 (which is a virtual package) or emerge perl-core/MIME-Base64 though you probably already have it.)
  • irssi (... duh!)

Installation:
  • First make sure all requirements are installed (see above).
  • To install, just put the script in ~/.irssi/scripts and put this in your ~/.irssi/startup :
  • /load ~/.irssi/scripts/blowssi.pl
             
More detailed installation instructions: http://mewbies.com/h...r_irssi_tutorial.htm

6
First post on new server is mine!!! muahaha   >:D

8
Mircryption / FreeBSD
« on: May 29, 2009, 08:03 PM »
Looks like Mircryption made it into FreeBSD's official port collection at some point or another! It's been in there since 2005.
I was hanging out with mouser and apparently he never knew about it! :)

 :beerchug:

[ excerpt from developer's web site with modifications ]

Mircryption is a free encryption add-on for the popular irc clients
mIRC and XChat. Features:

- Channel text, Private query windows, DCC Chats, Actions, Topics can
all be encrypted. All crypto-related algorithms used are taken from
published, common, trusted sources. Encryption algorithm is Blowfish
(no known vulnerabilities); encryption keys are themselves stored
in encrypted form.

- Supports CBC mode encryption.

- No need to modify the way you work - text is encrypted and decrypted
automatically; encryption status of conversations is clear but
unobtrusive.

- User-friendly key management routines; menu driven and easy to
temporarily disable & re-enable encryption on a channel, send plain
text quicky, etc.

LICENSE: free without any limitation

WWW: https://www.donation...ircryption/index.php

http://www.freshport...c/xchat-mircryption/

9
usr.png

Ran across this interesting read, explaining some of the history of the /usr folder :

  http://bsdtips.utcor.../index.php/Helio/usr

The article suggests a very nice way to have all binaries into the same folder (ie, unite /bin and /usr/bin) on FreeBSD using nullfs and union.

I found the historical bit about the magnetic tapes for / and a faster disk for /usr was particularly interesting :)

I figured I'd share the link... :)

10
In today's "web 2.0" world, web applications become more and more complex, and thus it becomes more and more common for some very nasty security bugs to be implemented.

As a web developer, being able to scan your own software for common things like SQL injection bugs or cross-site scripting vulnerabilities, may be a useful tool in your tool belt.

As a server administrator, being able to scan your server, and your user's sites for these problems is also a handy thing to be able to do.

There is quite a few of these web vulnerability scanners available commercially, and I had always wondered how effective they are. Someone on the penetration testing mailing list wrote up a very very nice review (PDF) of major vendors of this type of software.

Since it would be of interest of users of web-applications as well as developers and fellow server admins, I figured I'd share this here.

http://anantasec.blo...ners-comparison.html

From the report it seems that these things are pretty good at detecting common stuff like sql-injection (report shows that all sql-injection vulnerabilities were detected by all the tested software), but you can definitively not rely on them solely for security testing. (Which makes sense imo, since it's a very complex problem which seems hard to implement generic heuristic scanners for.)

11
Developer's Corner / The New line character \n\n
« on: September 01, 2008, 11:56 AM »
I stumbled on the NewLine article on wikipedia today during some random browsing, and I never expected it to be so fascinating.

It shows some interesting history, and how many different Operating Systems have different control characters to represent a new line, and for different reasons.

There is also some confusion as to whether newlines terminate or separate lines. If a newline is considered a separator, there will be no newline after the last line of a file. The general convention on most systems is to add a newline even after the last line, i.e., to treat newline as a line terminator. Some programs have problems processing the last line of a file if it isn't newline terminated. Conversely, programs that expect newline to be used as a separator will interpret a final newline as starting a new (empty) line. This can result in a different line count being reported for the file, but is otherwise generally harmless.

wow... I never even thought about it that way. I guess it can be interpreted both as a separator and as a terminator. I can see how some interoperability problems could occur. This is one of those things that, when I really think about it, makes me realize that it's a small miracle that software as we have it today works at all! - When programs can't even agree on what a new line is, or even how to treat it.

It doesn't stop there, the problem persists on our internets:

Most textual Internet protocols (including HTTP, SMTP, FTP, IRC and many others) mandate the use of ASCII CR+LF (0x0D 0x0A) on the protocol level, but recommend that tolerant applications recognize lone LF as well. In practice, there are many applications that erroneously use the C newline character '\n' instead (see section Newline in programming languages below). This leads to problems when trying to communicate with systems adhering to a stricter interpretation of the standards; one such system is the qmail MTA that actively refuses to accept messages from systems that send bare LF instead of the required CR+LF.

12
Mircryption / mircryption-compatible script for irssi
« on: August 08, 2008, 03:06 AM »
[ Invalid Attachment ]

I created an irssi script that lets you use mircryption (and FiSH) compatible encryption.
It supports both ecb and cbc modes.

You could already use FiSH with irssi, which is compatible with mircryption, but it has some security problems (and is generally written very sloppy, not to mention it's a pain to compile/install), hence the new effort.

Getting plain ecb to work was easy, but there was some serious debugging to do trying to resolve a weirdness/limitation/bug in perl's Crypt::CBC cpan module. (which mouser pretty much resolved for me-- THANKS!!)

Click to get the script. :)

13
[ Invalid Attachment ]

Recently featured on the OSNews blog was an article on compuworld with the author of the D programming language, Walter Bright.

D takes C++ and incorporates elements from more modern programming languages such as ruby,python,java,etc...
I find this particularly interesting because D remains a true systems programming language, with many of the original concepts that make me stick to C++ in it.

It looks like D has come a long way since I last tried it, and they are getting ready for their 2.0 release (alpha has been released now).

D is not without it's problems, for example, it's standard library has been forked and is not compatible with the original stdlib. Bright addresses this and other criticisms on the language in the article above.

Very interesting read!

14
mouser and I have been using redmine lately for various projects, and I must say it really helps productivity.
I find this kind of the ultimate `getting-things-done` tool, even if you don't need a bugtracker for what you're doing per se. It's a bit hard to explain everything so I'll just break down the features below:

  • It has advanced issue tracking (bugtracker), with customizable fields. (ie, you can add your own fields issue reporters can fill out, or customize existion options of issue categories, bug status, etc...)

  • It integrates with most common source control systems like subversion, cvs, mercurial, etc...
    This includes showing colored diff's if you want to compare 2 different versions of a file from an older revision for example.

  • It can generate gantt charts for all tasks a project. And it will even output these in PDF or PNG format so you can print them or easily share them with people!

  • It has a calendar feature, showing when issues are due and when they were filed.

  • It can send out email notifications for issues you 'watch' -or- for all changes

  • It can generate atom feeds for pretty much any page. So you can have an atom feed of all recent changes, all latest issues assigned to you, all latest unassigned issues, the latest svn commits,... If you can view it, you can get an atom feed from it, pretty much.

  • It has advanced user and permission management. It has matrix tables of what user group is allowed to change what field in an issue, and which projects are to be private and which are to be public.

  • It lets you make wiki pages for your project.

  • It has a built-in editor for notes or other documentation, which you can categorize.

  • It allows you to upload files for projects, which can also be categorized.

  • It has version management, which lets you define (multiple) versions for a project(eg: v1.2.0). These can have a due date, and this will be shown in gantt charts and the calendar view. You can assign for which version a specific feature is due.

    Related to this is the roadmap feature, which will show a progress bar for each version you defined. Based on how many open/unresolved issues you have for a specific version of a project, and how many closed tickets there are. (if you have 10 open tickets and 10 closed tickets, the progress will thus be 50%)

  • It allows you to log time for specific issues, or for a project in general. And shows the total time spent on each project, or the total time spent 'this week' on your personal page (my page). This is a great feature allowing you to track how you spent your time. It can also generate detailed 'spent' time reports, which you can even filter by category etc... Great for GTD and tracking how you spend your time on things, and to see if you can improve your efficiency.

  • It has built-in forum support, you can have a discussion forum for your project at the click of a button, however it's nothing like smf(what we use for donationcoder). it seems a bit limited in what it can do, but could come in handy nonetheless.

  • It lets you make a 'news' page for your project, where all project members can catch up on the latest stuff they need to know. I don't use this feature a lot since it's mostly just jesse and me, and we talk about most stuff on IRC anyway, but I see how it could be handy if you have a project with more people, or even in an office environment.

  • It has a link to give you the PDF version of any page you're looking at, this means, very nice reports to print of anything!

  • Oh and it also allows you to mark certain projects as sub-projets of others.

I'm really a crappy writer/reviewer so please look at the screenshots of all this stuff ;) :


15
Developer's Corner / The internet hijacked
« on: May 20, 2008, 02:34 AM »
Recently the IP address for one of the root nameservers has changed.
These IP addresses are hard-coded in configuration files deep in the servers or many ISP's, and are hardly ever updated.

Some smart, sneaky, probably malicious entity figured they would grab the OLD ip address of the nameserver, and set up an unauthorized nameserver of their own, thus capturing all hostnames requested by pretty much most people on the internet. And also having control to what these hostnames resolve to (so thus having the ability to redirect anyone to any malicious proxy or site, intercept any data they want etc,...)

Read all about it

[ Invalid Attachment ]


So why do I post this in the developer corner section?

Things like this really make you reflect on security in your internet-enabled applications.
It should be assumed that any connection you make to a remote server can potentially be snooped upon.

Actually, a root dns server being hijacked is a bit extreme, but it is a lot easier for your data to be compromised. It only takes one compromised network on the route between the two parties(or the network of one of the parties themselves), and a mitm(man in the middle) attack is possible.

With the vast amount of botnets and compromised drone computers out there these days, it becomes more and more likely that you stumble upon a compromised network, and potentially make your data available to unauthorized parties.

Very few applications still use encryption these days. Only the most sensitive information is encrypted usually.

But data that doesn't seem sensitive at first sight can still be harmful if combined with (lots) of other data. Identity thieves are especially crafty at that kind of thing.

One reason you don't see as much (https) encrypted websites on the web as you should is because of a limitation in the https protocol: only one https domain name per ip address is possible. (eg, currently you can't have donationcoder.com and codycoins.com on the same IP, both using https). This is just one of many examples of how our current infrastructure is not built for the vast amount of threats that are present on the web these days.

So what are you doing to make your internet-enabled applications, web-applications, and websites ready for the remainder of the 21st century?

To conclude, a little scary quote from the article:
So the operators of such bogus name servers could operate for a very long time, providing correct answers or incorrect ones as they saw fit. They could log your requests to determine your interests and censor the ones they didn't like. In general, they could engage in all sorts of mischief, ranging from very targeted ("let's get this one individual or organization") to very wide-ranging ("let's blow away .com today").

16
Official Announcements / server news
« on: March 07, 2008, 12:16 AM »
The donationcoder server may have to be restarted a few times yet this week as we install things and fix little details here and there.
So please don't panic when you can't reach the server for a second :)

awanpmjadb.jpg

17
General Software Discussion / Minimize any window to tray on *nix
« on: March 06, 2008, 10:08 PM »
I've seen some mention of minimize-to-tray apps here on DC, I figured I would post this for the few fellow Linux users here who might want something like this:

With AllTray you can dock any application with no native tray icon (like Evolution, Thunderbird, Terminals) into the system tray. A high-light feature is that a click on the "close" button will minimize back to system tray.  It works well with Gnome,  KDE,  XFCE 4*, Fluxbox* and WindowMaker*

kde.png

I have set up a key shortcut in fluxbox, so I only have to press one button and click the window i want to send to tray. Comes in handy! Especially useful for thunderbird.

http://alltray.sourceforge.net/

18
Living Room / GPLv3 explained
« on: February 17, 2008, 12:22 PM »
Ever wonder what's different about the brand new GPL version 3 versus it's older kin, GPLv2?

Richard Stallman, the guy who came up with the GPL in the first place, explains in non-legalese
so we can all understand once and for all what it's all about:



rms.png

http://video.google....-1230218647830638736





19
Living Room / Guide: Earning income from a Free/Open Source project.
« on: February 13, 2008, 09:33 PM »
The brainchild and creator of the GNU/Linux distro "Damn Small Linux", a GNU/Linux distro for systems with limited hardware resources, has written up a little guide on how to make money as a FOSS developer from his experiences with DSL.

It makes quite an interesting read, since it covers the donation concept and some notes on the 'psychological barrier' and some of the harder choices many developers have to face when trying to survive developing only freely available software.

http://damnsmalllinux.org/income-guide/

dsldonate.png

20
Smalltalk is now usable as a web development scripting language thanks to seaside:

seaside.png

Why does smalltalk remind me of emacs? (in terms of wanting to do everything)

21
Looks like someone finally made an apt-get/emerge/yum/pkg-add/... tool for Windows!

win-get1.jpg

It can install and uninstall any software in it's repositories.
Stick a few win-install commands in a batch script and you have a great automated bulk software installer!

On the down side:

  • It doesn't look like it has any version control
  • It seems like anyone can add new software through their web interface, which raises some very serious security concerns!

Some pretty serious downsides, imo. It's beyond me how/why they made the decision to manage their repositories like that.

22
I am currently working on a scriptable alerting/monitoring application which I will try to finish (be)for(e) the contest. I'm writing this to monitor servers, but you could use if to alert or monitor about anything, the weather, a meeting, etc,...

All objects (alerts, sensors, GUI objects,...) will be scriptable in python.

A (very early) screenshot below,... not too much to be seen on there, most stuff I worked on sofar is backend:

23
wmpop3lb.png


If you're not familiar with the concept of dockapps (from the wikipedia entry):

Dockapps, or docked applications are computer programs which appear to reside inside an icon rather than a window in graphical computer systems. Their display is constantly-updated just like a windowed application, but appears inside a small (64x64 pixel) icon.

This makes dockapps particularly suitable for monitoring things in the background

Dockapps were heavily used in the NextStep Operating system, which was later cloned into WindowMaker(still actively developed), which became a popular window manager (before Gnome and KDE stole the spotlight.) Many window managers support dockapps in some way or another these days, including KDE, which has a special dockapp toolbar you can add (rightclick on your panel, add new panel, dock application bar) and Gnome, in which dockapps can be used in the gnome-swallow-applet. Fluxbox, supports dockapps through it's 'slit' bar, etc,...

There is an amazing amount of information and gui interface you can squeeze into such a little icon, and it's great that all these window managers have their own way of handling/displaying and interacting with these dockapps, so using them makes them truly integrated into your window manager/desktop.

I particularly enjoy this little dockapp, because next to just displaying information (latest emails you received, etc), it can also be interactively used to delete messages from the server, or launch any application depending on the message/pop3 server. This allows you to play a different sound or append different parameters to your email application, or run any creative command you can come up with.

If you take a look on it's website, you'll notice it is VERY customizable, and an amazing amount of functionality is hiding behind such a little interface!

I use it together with wmnetmon which allows me to monitor different services (eg: pop3, http, smtp, etc,...) on different servers, and also lets me run a custom command/program when a problem occurs with one of the servers.

The commands to run when a new mail has arrived allow you to pass about all information about the received email(s) to any command/program. This makes it very easy to make a little proxy program or script which will read the parameters, do something with them, and then pass it to your mail program. You could write your own personal/advanced spam filtering or email sorting/alerting program/script extremely easy this way.

24
Living Room / Crazy modem/router on the rebound
« on: June 01, 2007, 01:08 AM »
Last friday I noticed my modem/router (an actiontec GT704-WG) was acting strange. It's port-forwarding wasn't working as it should anymore, all in all, it seemed it's NAT was completely broken.

The next morning I walk up to the computer, and notice the Internet isn't working at all anymore. - I look at the modem, and it has it's status light solid red. (Not good,- the manual sais that when the red status light remains solid, there is a hardware or firmware problem.) I tried rebooting it, unplugging it, plugging it back in, anything I could think of, It wouldn't boot up, and the web interface wasn't accessible anymore.

At that point anyone else would have trashed the thing and bought a new one, but since I don't have a tree growing $100 bills, and also, since I didn't have anything better to do with my internet being down, I was a bit more persistent.

After lots of fiddling and trying, I noticed that my computer would get an IP about 2 seconds after I power on the router, and lose it again about 5 seconds later. This ip was 192.168.0.127.

I thought that was kind of strange, and interesting, so I set a static IP and disabled dhcp on my network settings, and i tried probing some ports during that 5 second window, and found out there was an FTP server accessible!

The ftp server announced itself as 'adam2'. My router's name isn't Adam, and I don't know anyone named Adam, so I went to a friends house to borrow their internet and do some googling. It turns out this is the routers bootloader, which gives you a 5 second window after startup to upload firmware.

$ ftp 192.168.0.1
Connected to 192.168.0.1.
220 ADAM2 FTP Server ready.

That was great news! It ment two things:
  1) My router wasn't fubar.
  2) I was able to try something that might fix it: replace/repair the firmware

Of course, It wasn't that easy. The Adam2 boot loader defines a set of environment variables to define the memory range of several partitions. (A kernel, file system, boot loader, boot loader settings, and some unknown partition labeled from mtd0 through mtd4) And the original firmware image of the manifacturer (Actiontec) is just one image file, not 2 or 5 image files. I tried splitting the image in several parts using the partition layout memory address numbers in the boot loader, but that didn't seem to work. I could upload the firmware but it wouldn't boot.

With no easy way to upload the firmware image of the manifacturer through the adam2 ftp interface, I was almost back at square one, but it just required some more persistense.

The OpenWRT project has a page on the Actiontec 701, which is appearantly a modem/router similar to mine (but without wireless).
On that same page it has some information about the router, and it mentions the router uses the AR7 architecture.

It turns out D-Link has a router running on that very same architecture (the DSL-G604T) and unlike Actiontec, D-link provides a recovery utility to replace the firmware through the ftp interface, using ONE image file.

I ran the utility and it uploaded D-Link firmware to my actiontec modem, I figured, maybe the web-interface will work, if I'm lucky, and I can use that to upload the original Actiontec firmware, or just replace the d-link image with the actiontec one in the recovery utility.

It turned out I didn't even have to, because, appearantly, the D-Link software is running with no problems on my Actiontec router, eventhough it has completely different hardware. I can now get back on-line, use NAT and port forwarding, even wireless works. All features in the web-interface work etc,...

This D-Link software seems to have more features(see screenshot) in it's web-interface than I've ever seen in a modem/router; so why would I replace the original buggy and featureless actiontec firmware if the D-link firmware works just as well?

It turns out I was rather lucky the D-Link firmware even boots, since the device it was written for has at least twice as much memory as my Actiontec piece of junk.

The memory constraint had me worried, so I did a small stress test by calling on my VoIP while downloading stuff (probably not the best test one could do, it's not like p2p) and it worked fine. But at least now if I ever encounter problems I can revert back to the original firmware. (Though I'd like to avoid it if possible)

The original Actiontec firmware hasn't been maintained or updated since 2005 and it is full of bugs. One of the most annoying bugs is that it wants to log every dns-request without ever deleting/cycling the cache. When the memory is full, the firmware craches. Using any p2p app for 5 mins will do that. There is a temporary fix (by telnetting to the modem and disabling the caching), but it gets lost after reboot. So that's why I'd rather keep the D-Link firmware if I don't have any problems with it (so far so good)




25
Developer's Corner / secure automated backup on *nix.
« on: May 26, 2007, 01:50 AM »
After having lost months of work on various projects(ironically one of them was a backup tool) due to HD crashes and such, I wrote a little Bash shell script that will automatically archive a directory (and all it's sub-folders) and upload it via secure copy (scp) to a remote shell account. I figured I would share this with my dc buddies in case any one can use it. ;)

It reads a simple configuration file in which you can configure a few things, including files to EXCLUDE from the backup. (for example: object files and other garbage files generated while compiling a program).

I will post step-by-step instructions on how to use this, but first, here is the script:


Code: Text [Select]
  1. #!/bin/bash
  2.  
  3. ###########################################################################################
  4. #                                                                                         #
  5. # Simple secure automatic backup script by Gothi[c]                                       #
  6. # https://www.donationcoder.com                                                            #
  7. #                                                                                         #
  8. # Takes 1 argument: settings file                                                         #
  9. #                                                                                         #
  10. # Settings file can have the following directives:                                        #
  11. #                                                                                         #
  12. # - backup (which folder to back up)                                                      #
  13. # - scphostname (scp remote machine host name)                                            #
  14. # - scpusername (scp username on remote machine)                                          #
  15. # - scpdestdir (scp destination folder on remote machine)(optional)                       #
  16. # - except files (which files to exclude from the backup) (can have multiple directives)  #
  17. # - logfile (where to log events)                                                         #
  18. # - scpdestfile (optional filename on remote server, if not specified one will be         #
  19. #                generated based on the current date)                                     #
  20. # - enable scp (whether or not to enable scp upload of backups)                           #
  21. # - enable email (whether or not to enable emailing backups)                              #
  22. # - email (email address to send backups to, if enabled)                                  #
  23. # - sendmail (optional)(path to the sendmail program, used to send email)                 #
  24. #                                                                                         #
  25. # Requires following GNU utilities to be installed (these are present on about any GNU    #
  26. # system): cat,sed,grep,tar,bzip2                                                         #
  27. #                                                                                         #
  28. # Requires following GNU utilities to be installed for scp uploading: scp (openssh)       #
  29. #                                                                                         #
  30. # Requires following GNU utilities to be installed for emailing: sendmail, uuencode       #
  31. #                                                                                         #
  32. ###########################################################################################
  33.  
  34. #### first check the sanity of our user. ####
  35.  
  36. if [ ! -n "$1" ]; then
  37.   echo "ERROR: Missing settings file argument."
  38.   echo "Usage: $0 settingsfile".
  39.   exit $E_BADARGS
  40. fi  
  41.  
  42. #### check if settings file is readable ####
  43.  
  44. if [ ! -r "$1" ]; then
  45.   echo "ERROR: Could not read provided settings file: $1."
  46.   echo "Please ensure the file exists and that you have read permissions to it."
  47.   exit $E_BADARGS
  48. fi
  49.  
  50. #### init variables ####
  51.  
  52. SETTINGS_FILE=$1
  53. LOCAL_SRC_FOLDER=`cat $SETTINGS_FILE | grep "backup:" | sed -e 's/backup:\( \)\?//g' | sed -e 's/\( \)\+//'`
  54. ARCHIVE_FILENAME=`basename $LOCAL_SRC_FOLDER`-`date +%F`.tar.bz2
  55. REMOTE_HOSTNAME=`cat $SETTINGS_FILE | grep "scphostname:" | sed -e 's/scphostname:\( \)\?//g' | sed -e 's/\( \)\+//'`
  56. REMOTE_USERNAME=`cat $SETTINGS_FILE | grep "scpusername:" | sed -e 's/scpusername:\( \)\?//g' | sed -e 's/\( \)\+//'`
  57. REMOTE_DIRECTORY=`cat $SETTINGS_FILE | grep "scpdestdir:" | sed -e 's/scpdestdir:\( \)\?//g' | sed -e 's/\( \)\+//'`
  58. REMOTE_FILENAME=`cat $SETTINGS_FILE | grep "scpdestfile:" | sed -e 's/scpdestfile:\( \)\?//g' | sed -e 's/\( \)\+//'`
  59. LOG_FILE=`cat $SETTINGS_FILE | grep "logfile:" | sed -e 's/logfile:\( \)\?//g' | sed -e 's/\( \)\+//'`
  60. EXCEPTIONS=( `cat $SETTINGS_FILE | grep "except files:" | sed -e 's/except files:\( \)\?//g' | sed -e 's/\( \)\+//' | sed ':a;N;$!ba;$s/\(.*\)\n/\1 /'` )
  61. EMAIL=`cat $SETTINGS_FILE | grep "email:" | sed -e 's/email:\( \)\?//g' | sed -e 's/\( \)\+//'`
  62. SCP_ENABLED=`cat $SETTINGS_FILE | grep "enable scp:" | sed -e 's/enable scp:\( \)\?//g' | sed -e 's/\( \)\+//'`
  63. EMAIL_ENABLED=`cat $SETTINGS_FILE | grep "enable email:" | sed -e 's/enable email:\( \)\?//g' | sed -e 's/\( \)\+//'`
  64. PROG_SENDMAIL=`cat $SETTINGS_FILE | grep "sendmail:" | sed -e 's/sendmail:\( \)\?//g' | sed -e 's/\( \)\+//'`
  65.  
  66. #### create archive ####
  67.  
  68. TAR_COMMAND="-cvjf /tmp/$ARCHIVE_FILENAME $LOCAL_SRC_FOLDER"
  69. for exception in $(seq 0 $((${#EXCEPTIONS[@]} - 1))); do
  70.   TAR_COMMAND="$TAR_COMMAND --exclude ${EXCEPTIONS[$exception]}"
  71. done
  72. tar $TAR_COMMAND &> /dev/null
  73.  
  74. #### scp upload ####
  75.  
  76. if test "$SCP_ENABLED" != ""; then
  77.   if test "$REMOTE_FILENAME" = ""; then
  78.     SCP_REMOTE_FILE="."
  79.   else
  80.     SCP_REMOTE_FILE=$REMOTE_FILENAME
  81.   fi
  82.   SCP_COMMAND="/tmp/$ARCHIVE_FILENAME [email protected]$REMOTE_HOSTNAME:.$REMOTE_DIRECTORY/$SCP_REMOTE_FILE"
  83.   scp $SCP_COMMAND &> /dev/null
  84. fi
  85.  
  86. #### email upload ####
  87. echo "email enabled = $EMAIL_ENABLED"
  88. if test "$EMAIL_ENABLED" != ""; then
  89.   echo "email enabled"
  90.   if test "$PROG_SENDMAIL" = ""; then
  91.     PROG_SENDMAIL="sendmail"
  92.   fi
  93.   if test "$EMAIL" != ""; then
  94.     cat /tmp/$ARCHIVE_FILENAME | uuencode /tmp/$ARCHIVE_FILENAME | ${PROG_SENDMAIL} $EMAIL
  95.     echo "email sent"
  96.   fi
  97. fi
  98.  
  99. #### delete temporary archive file ####
  100.  
  101. rm /tmp/$ARCHIVE_FILENAME
  102.  
  103. #### logging ####
  104.  
  105. if test "$LOG_FILE" != ""; then
  106.   touch $LOG_FILE
  107.   if [ -w $LOG_FILE ]; then
  108.     THE_DATE=`date +%F`
  109.     THE_TIME=`date +%T`
  110.     echo "[$THE_DATE] ($THE_TIME): Completed backup for $SETTINGS_FILE." >> $LOG_FILE
  111.   fi
  112. fi
  113.  
  114. exit 0
(you can download it here)



Here is how I recommend you set it up:

  •   Download the script above and copy it to your /usr/local/bin -or- /usr/bin -or- /bin directory
     
  •   Make sure you can execute it, just type autobackup (i am assuming in this guide that you saved the script under that filename) and hit enter, you should get something like: "ERROR: Missing settings file argument." Which is good news, it means the script executes and is in our execute path. (if you get a command not found error, try moving the script to a different bin directory (eg: /bin)) (also note that you need to be root to write into these folders)

    You may or may not have to chmod it (chmod a+rx /usr/local/bin/autobackup) (replace /usr/local/bin with your bindir)
     
  •   Decide where you want to store the configuration files, a good place would be /etc/backups.
      In this guide I will use as example, a project called bpmnotepad of which i want to keep a daily, weekly, and monthly backup.

      So I am going to create the configuration files bpmnotepad-daily, bpmnotepad-weekly and bpmnotepad-monthly.

      First I need to create the /etc/backups directory, so as root, "cd /etc" and then "mkdir backups" (without the quotes of course)

      I will want to run these backups as my regular user (eg: the user gothic) so i am changing the ownership of that folder with "chown gothic /etc/backups" so the user gothic can read and write that folder. (maybe also make sure to chmod it, just in case your default permissions are restrictive (rare though) using the command "chmod +rw /etc/backups"
     
  •   I also want my backed up files to not just be dumped into the home folder on the remote machine where I have shell access, so I am going to ssh connect to the remote machine and create a backups folder in the home directory on the remote machine. (ssh [email protected],   then mkdir ~/backups) (the ~ tilde is a shortcut to your home directory)
     
  •   We also don't want scp to prompt us for a password, for this to work securely, we'll have to upload our public ssh key to the remote server and tell it to trust us. If you don't have a public ssh key yet, you can create one by running the command "ssh-keygen -t dsa" on your LOCAL machine, then paste the contents of the generated PUBLIC key file on the remote machine into the file ~/.ssh/authorized_keys To test if you no longer need the password, disconnect from the remote machine, and re-establish an ssh connection (ssh [email protected]) and it should not prompt you for a password. If you are having problems with this step, there is an exellent tutorial here
     

Now here are the example configuration files for our bpmnotepad project, which will go in /etc/backups:

/etc/backups/bpmnotepad-daily
backup:        /home/gothic/development/projects/bpmnotepad
logfile:       /var/log/backups/bpmnotepad

except files:  *.d
except files:  *.o

enable scp:   yes
scphostname:   linkerror.com
scpusername:   linkerr
scpdestdir:    /backups
scpdestfile:   bpmnotepad-daily.tar.bz2

/etc/backups/bpmnotepad-weekly
backup:        /home/gothic/development/projects/bpmnotepad
logfile:       /var/log/backups/bpmnotepad

except files:  *.d
except files:  *.o

enable scp:   yes
scphostname:   linkerror.com
scpusername:   linkerr
scpdestdir:    /backups
scpdestfile:   bpmnotepad-weekly.tar.bz2

/etc/backups/bpmnotepad-monthly
backup:        /home/gothic/development/projects/bpmnotepad
logfile:       /var/log/backups/bpmnotepad

except files:  *.d
except files:  *.o

enable scp:   yes
scphostname:   linkerror.com
scpusername:   linkerr
scpdestdir:    /backups
scpdestfile:   bpmnotepad-monthly.tar.bz2

As you can see, the only thing that changes in the different files is the remote filename, so we keep 3 copies at all times, which are overwritten with each scheduled backup. Also don't forget to edit the 'backup' line and have it point to the folder where your project or folder you want to have backed up is located. also notice the 'except files' lines, these tell us that i don't want any files with the .d or .o extention in my backup (c++ object files), these lines are optional, you can add as many exception file masks as you want.
The destdir and destfile lines are also optional. When destfile is not given, a filename will be generated from the name of your project/to_backup folder + the date of the backup. (also see information in the script header)

The logfile line is also optional, i forgot to mention this earlier, if you want to keep a logfile, you can create a directory /var/log/backups (follow the same steps as you did to create the /etc/backup directory, but apply to /var/log instead of /etc) -OR- just make it log to some file in your home directory, put whatever you want. or just remove the logfile line.

  • Now we should have everything set up for our backups. Before we make them run automatically, we should test if it actually works. To do so, in the context of our example, we would issue the following command:

    autobackup /etc/backups/bpmnotepad-daily

    ( the script takes only 1 argument (the configuration file to use) )

    If everything went well, the script should pause for a while (depending on how much you have to backup, it can take a while), and then return back to the prompt. The script is NOT verbose and will not give you any output when successful (as is the GNU standard). There will only be output when errors have occured.

    After the command finishes, doublecheck on the remote server if the backup file was created.
  • If the above test was successful, we can now do the actual scheduling part. For this we will use cron.
    create a new temporary file, and put something like this in it:

    0 1 * * * autobackup /etc/backups/bpmnotepad-dayly
    0 1 * * 1 autobackup /etc/backups/bpmnotepad-weekly
    0 1 1 * * autobackup /etc/backups/bpmnotepad-monthly

    The syntax of this is:
    minute_of_hour hour_of_day day_of_month month_of_year day_of_week command_to_run
    (the example backs up every day at 1 AM for the daily backup, every monday at 1am for the weekly backup and every 1st day of the month at 1am for the monthly backup)
    (more information on this here)

    After creating the temporary file run the command:

    crontab tmpfile

    (where tmpfile = the temporary file you just created)



That's it, now we are set up for automated backups over a secure connection. I know it seems like alot and the above guide may be intimidating to look at, but the only reason why it's so long is because I've tried to be very elaborate.

I hope someone else besides me can make some use of it ;)
I'll put this script + guide up on my website at some point.


(ps: sorry it isn't an ahk script, i'll leave that to skrommel, but us *nix geeks are allowed some fun every now and then too ;) )

Pages: [1] 2next