Networking For Men

April 8th, 2008

My awesome Informatics tutor showed me this trick after class yesterday. The tool is called netcat, or nc for short, and it’s a swiss army knife of network communication. While most network communication happens over an application layer protocol like HTTP, FTP, SMB, NTP, MSNP, IMAP, POP, SMTP, XMPP etc etc, nc allows you to get underneath these and establish raw TCP and UDP connections to send data. You can even manually talk one of the application layer protocols yourself. Netcat is installed by default on most Linux installations and can be manually installed on Windows.

Chat

Get computer A to listen for incoming connections on some unused port. You can usually pick any number between 1 and 65,535, and Netcat will tell you if it is already being used by another program. The only ports that might be being used are 445 for Windows file sharing and that of any other network services your computer is providing. The -l switch starts listening and the -p switch defines what port. You can also add the -v (verbose) switch to see connection information.

nc -l -p port

Get computer B to connect to computer A on said port using either it’s IP address or hostname/domain name.

nc host port

For example, I set my computer, tuxmachine, to listen on port 38421 and to show connection information.

nc -l -v -p 38421

And I set my friends computer to request a connection to mine on port 38421.

nc tuxmachine 38421

Every line typed on either computer will appear on the other until one closes the connection with Ctrl+C.

Send Files

Get computer A to listen for incoming connections on some unused port, and redirect what it receives to a file.

nc -l -p port > file

Get computer B to connect to computer A on said port and immediately start sending the file. cat file takes the contents of file and prints it as standard output. | pipes this output into the input of nc, as though you were typing it with your keyboard.

cat file | nc host port

For example, I set my computer to listen on port 53817 and save the output as herubuntu.iso.

nc -l -p 53817 > herubuntu.iso

And I set my friends computer to request a connection on port 53817 and start sending the file myubuntu.iso.

cat myubuntu.iso | nc tuxmachine 53817

So now my friend is sending the file myubuntu.iso and I am saving it as herubuntu.iso. Once all the data has been sent, Ctrl+C closes the connection.

And for this all you need to have done is set up an IP network, by having assigned each computer an IP address, usually done automatically. No pain setting up Windows file sharing or configuring complicated and broken third-party applications. Your in control, and it’s just too easy!

Hardware clock as UTC in Windows

January 14th, 2008

You can make Windows treat and set the hardware clock as UTC by adding the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr ol\TimeZoneInformation\RealTimeIsUniversal as a DWORD Value (REG_DWORD) and setting it to 1.

If you dual boot Windows with almost any other operating system (Mac OS, Linux), the time will be wrong in Windows because it treats the hardware clock as local time and will set it to local time if you have it set to sync with Internet time (NTP) servers, whereas other operating systems treat it as UTC and will set it as such. This fixes that so Windows will treat the hardware clock the same as most other operating systems.

The solution came from here: Storing system time in UTC in Windows XP. Funny that the solution came from someone in the same country and time zone as me. :D

Easiest Samba Ever

January 8th, 2008

Contents of /etc/samba/smb.conf:

[global]
workgroup = MSHOME
[homes]
writeable = yes

Sets your workgroup to MSHOME and sets the home directories to visible and writable by their associated users. Tested and works great on Ubuntu. No hassling around with the long and wordy default configuration file. :)

Note that users who want to access their home directories from across the network need to be added to the Samba password file with the command sudo smbpasswd -a username, along with a password with which to access their files. They can then change their Samba password themselves with the command smbpasswd.

It would be nice if a separate password file didn’t need to be maintained for Samba, but instead, just like FTP or SSH, it simply used the system passwords and without needing to explicitly add users. Does Lazyweb know how?

lopl

December 4th, 2007

It’s been a good 20 minutes after this conversation and I’m still laughing at it. I don’t know why. Some things, the way they are said (or in this case, appear to be said), just tickle my funny bone. Seriously, this is bash.org material.

(11:57:20) Schalken: brb
(11:57:24) F: mmk
(11:59:20) Schalken: b
(11:59:27) F: oh yer
(11:59:42) Schalken: yer
(11:59:45) Schalken: totally
(11:59:51) F: mmmyesh
(12:00:01) Schalken: lmao wtf?
(12:00:15) F: you did get the picture right?
(12:00:19) F: the little emoticon dod
(12:00:23) F: with his tophat and whatnot
(12:00:26) Schalken: yeh he’s rad
(12:00:29) Schalken: yer*
(12:00:30) F: mmmyesh
(12:00:38) F: he doesnt say lol
(12:00:41) F: hes says lopl
(12:00:44) F: the p’s for posh
(12:00:48) F: mmmyesh
(12:00:56) Schalken: laugh out posh loud?
(12:01:03) F: ezackaly
(12:01:14) F: hes posh
(12:01:19) F: he has no need for good grammar
(12:01:28) Schalken: roflmao
(12:01:36) F: or
(12:01:53) F: rotflbmalfo
(12:02:00) F: as the case may be
(12:02:16) Schalken: lbmalfo?
(12:02:32) F: rolling on the floor laughing because my artificial limbs fell off
(12:03:01) Schalken: …
(12:03:03) Schalken: wtf?
(12:03:07) F: haha
(12:03:21) F: well if your artificial limbs fell off youd be rolling on the floor
(12:03:25) F: and it would be pretty funny

kde4: politicking. my 2¢.

December 1st, 2007

Re: kde4: politicking. game on., game on, indeed

The unsuspecting user is all-of-a-sudden confronted with a totally different manner of conducting his desktop business. Think rearrange all his drawers, change the configuration of his chair, lower his desk 5 centimeters and hiding his pens-and-pencils kind of change. I think that is unacceptable.

And what is wrong with that? If something is to grow then it needs to change (growth is change, after all) and that applies to everything, businesses, processes, standards—everything.

KDE4 is supposed to improve upon KDE3, and now your saying that KDE4 is too different from KDE3?

If that’s not what you’re saying, but rather that while change needs to occour, it has to occour smoothly and with minimal disruption, then I wholeheartedly agree. Perhaps we should have made a KMenu?

Ability VS Reliability

December 1st, 2007

Re: There’s way to much Ubuntu everywhere!

It is interesting the tradeoff we make between having stable software and having recent software.

I tried Debian Stable for a little while, and honestly could not deal with using software that has been rerealsed three times since. (Old GNOME and Xfce icon themes, ugh!) Then I tried Debain Unstable and the system was completely broken. Then I tried Debain Testing and the system worked, mostly, and had relatively recent software as well. But Ubuntu has even more recent software, but is slightly more unstable.

the tree structure of a software system

It is impoartant to recognise that software systems work in layers. At the bottom layer you have the hardware, then you have the kernel itself, then you have the GNU tools and core libraries, then you have an X server and UI libraries, then you have a desktop environment, then you have userland applications—the things we actually use to get work done.

This is a good model because it is also the order with which we want our stability/ability tradeoff to change. It is like a tower where each level depends on the stability of the levels below. When the hardware dies, everything dies. When the kernel dies, well, you’ve lost everything, but you might have another operating system you can use. But when one userland application dies, we only lose the functionality that application provided.

It also follows the layers of a package manager’s dependency tree. More things will depend on xlib than they will on miro. Miro could therefore be distributed as soon as the developers release it, however xlib needs special testing because so many other pieces of software depend on it. We want our hardware and our kernels to be rock solid, but at the same time we want our userland applications to be able and the latest.

It is frustrating that Linux distributions dont appear to recognise this. They believe all software at all layers of the hierarchy should be released at the same time, as Ubuntu Linux 7.10 or OpenSUSE 10.3 or Debian Etch, but it just doesnt work that way.

There really is one solution to this problem - backport teams. If Debian Backports were not such a joke and actually backported the software that I need to Debian stable, I might use Debian stable for it’s stability. In fact, if that was the case, maybe Ubuntu never needed to be created.

On What They Call “Usability”

December 1st, 2007

In the comment thread for liquidat’s article, KDE 4: some reasons for design decisions, there was a discussion on the usability aspects of Novell’s Kickoff menu, which is likely to be the only menu ready for inclusion in KDE 4.0.

Let me start by saying I am not a fan of the Kickoff menu, and for good reason. Amongst OpenSUSE’s other weaknesses, it’s default menus for both GNOME and KDE are simply not usable, and is one of the many reasons I turned down OpenSUSE. Defaults are increadibly important. You can only expect the most powerful of power users, as they are called, to configure their computer the way they like it. The majority will use the defaults, that’s why a good default menu is important for KDE, if not for 4.0, but for 4.1 and 4.2.

I’m going to use Kickoff as an example since it was being discussed, but it’s weaknesses are also applicable to the GNOME Main Menu/SLAB Menu.

So, let me set the record straight on how many mouse operations is required to operate each of the menus. I’m going to consider two basic operations: moving the mouse, and clicking the mouse. This actually applies to normal mouses as well as trackpads and pointing sticks, where moving the cursor is less intuitive.

Note that in favour of Kickoff, I have considered a click-and-drag as one operation for scrolling and resizing.

Let’s say I want to go to Multimedia > Video, see the whole list of programs, then go to Graphics > GIMP. Starting from wherever the cursor may be on the screen:

With KMenu:

Move the cursor onto the KMenu Click the KMenu Move the cursor onto Multimedia (menu opens automatically) Move the cursor onto Video (entire list of apps is shown) Move the cursor back onto Graphics Move the cursor onto GIMP Click on GIMP

With Kickoff:

Move the cursor onto Kickoff (menu opens automatically) Move the cursor onto Multimedia Click on Multimedia Move the cursor onto Video Click on Video Move the cursor onto the scrollbar Click and drag on scrollbar to scroll the list of apps Move the cursor onto the back button Click on back button (to go back to Multimedia) Click on back button again (to go back to root menu) Move the cursor onto Graphics Click on Graphics Move the cursor onto GIMP Click on GIMP

Note also that the “Click and drag on scrollbar to scroll the list of apps” operation could have been replaced by a resizing of the menu, which would also require a click-and-drag.

Yes, common tasks take twice as many mouse operations in Kickoff than they do in the KMenu. In fact, they likely take longer, since every time you go up or down a level in the menu you have to wait for the sliding transition effect to finish, each “move the mouse onto” operation may have required scrolling in order to find the desired entry, and you can’t see the entries in the menu levels above the current one like you can in the KMenu. Not to mention that the user may accidentally have switched the tabs at the bottom by hovering the mouse over them, and they would have to start again.

The GNOME Main Menu/SLAB Menu is in the same league. Not only do you have to scroll your list of applications, but you have to open a separate window, that takes a good couple of seconds to open, in order to get to said list. However, once it is open, all of your applications are immediately visible and categorised, which is desirable for browsing, and the menu itself makes your “favourite applications” available to you immediately with one click, which is another positive aspect.

However, despite claims as being the results of extensive usability testing, neither of these menu systems provide the efficiency and effectiveness of the plain simple menus currently offered in vanilla GNOME and KDE desktops, which beat the Windows 95 menu by making the applications categorised. However, these menus have been around since the mid 90s, and if you want 21st century usability, you’ll have to turn to Mac OSX and Windows XP/Vista. KDE and GNOME could learn a lot from the research they have invested in their interfaces.

Angry Guitarist

November 29th, 2007

I used to be huge into Evansescance when The Open Door came out. Just listening to Sweet Sacrifice, and I’m reminded why. The guitar in the chorus sounds like its about to eat you alive!

musings from aseigo

November 29th, 2007

I was reading the KDE Planet this afternoon and came across this piece by Aaron Seigo, who is the lead developer of the desktop interface for KDE4.

Some things struck me:

It is often said that young people accomplish such amazing things simply because they don’t know that they can’t do it.

…the question is whether the rules are imposed as external guides or whether they are based within our own selves and emerge outwards; whether the rules are everything or simply the contract of support between us while we do everything else we do.

In other news, that very KDE developer reports that Konqueror will be able to undo the closing of tabs in KDE 4.0. Whoo hoo! I could have made use of that feature right when I was writing this post.

Technical Drawing

November 25th, 2007

This is a picture I put together in Inkscape to explain to a friend the simple relationship between tech drawing systems in Visual Communication.

[image]



You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser
Mobilytics