- bits & pieces about software development HostingAbc Logo
Pages:01>>
Here is my first Dashboard Widget for Mac OS X !
It can do the following:

1. download any URI into a temporary file
2. view the content of the downloaded file in TextMate or Dashboard
3. has a settings page where we can set the viewer to be used (TextMate / Dashboard)

Enjoy :)
Download: XmlViewer Dashboard Widget
created on: 10/15/2009 1:26 PM
hits: 190
comments: (0)
If you ever need to use mono on Mac OS X, and you receive a message like "libcups not found. To have printing support, you need cups installed" or "System.DllNotFoundException: libcups.so.2" then do the following:

1. cd /usr/lib
2. sudo ln -s libcups.2.dylib libcups.so.2

This will solve your problems ;)
created on: 9/21/2009 2:42 PM
hits: 208
comments: (0)
This weekend the second iPhone application was just published at the Apple AppStore, you can download it here: Mozi24 @ AppStore
created on: 9/15/2009 3:47 PM
tags:
apple(6)
hits: 187
comments: (0)
On Snow Leopard there is a possiblity now to create a Service for every application (check my other article http://moszi.net/dev/BlogPost415_Mail_Things_linked_together_again_in_Snow_Leopard.aspx on how to create a service) and invoke the "Start Screen Saver" action.
You also need to set in the security preferences to ask a password immediately as the screen saver starts, and assign a shortcut to this action in the keyboard preferences.
created on: 9/8/2009 5:01 PM
tags:
apple(6)
hits: 221
comments: (0)
There is a great thing Apple gave us with Snow Leopard - the Services. With Snow Leopard there is a possibility to create a so called Service for an application – and we can perform various actions in this service.

For instance we can create a service for Mail to link the selected message to Things - which is a great way of managing the messages we have to act on.

In this tutorial we are going to achieve the following: - create a service for Mail.app - write a script in this service that will link the currently selected message to Things - use the "Keyboard" preference pane to assign a shortcut to the new service

1. Launch Automator (Applications -> Automator, or use spotlight)

From the "Choose a template for your workflow" select Service, then click Choose.


2. In the top of the window select "no input" and "Mail.App" for the service properties, just as it is in this screenshot:


3. From the Utilities section in Library (on the left side) choose "Run Applescript" and drag this action onto the workflow.

4. Replace the "(* Your script goes here *)" text with the following:
tell application "Mail"
	set selectedMessages to selection
	
	if (count of selectedMessages) is equal to 0 then
	else
		set theMessage to item 1 of selectedMessages
		
		set theSubject to subject of theMessage
		set theMessageId to message id of theMessage
		set theSender to sender of theMessage

		set message_url to "[[url=message:%3C" & ¬
			theMessageId & ¬
			"%3E][/url]" & ¬
			theSubject & ¬
			""
		
		tell application "Things"
			
		set newToDo to make new to do ¬
		with properties {name:theSender & ¬
		" : " & theSubject, due date:current date, ¬
		notes:message_url} ¬
		at end of list "Mails To Answer"
						
		end tell
	end if
end tell


5. Save the service, and name it as "Link Selected Mail To Things"

At this point you should be able to see a new menu point in Mail under the Services menu called exactly the same way you named your service. Go ahead, select a message in Mail then click on this menu point - and a new todo item will be created in Things and the selected message already should appear as a link in the new todo's note field.

Now there is a trick you can do to invoke this service from a keyboard shortcut. Just open the Keyboard preference pane from System Preferences, then:

* choose application shortcuts
* add a new shortcut for the Mail.App application
* enter the name of your service exactly in the Menu Title
* assign a shortcut to this item.

Now you have a nice shortcut in Mail to immediately link the message to things ;)

I've also created an article again at CulturedCode's website. Here is the link ;)
http://www.culturedcode.com/things/wiki/index.php/Creating_a_service_for_Mail_in_Snow_Leopard
created on: 9/4/2009 10:16 PM
tags:
apple(6)
hits: 259
comments: (0)
I've just created a wiki page on culturedcode that develops the application called "Things" - a GTD based task management tool, that I really like.
The wiki page can be found here: http://www.culturedcode.com/things/wiki/index.php/AppleMailToThings and it describes how to automatically create new Things todo items from the currently selected message in Mail.

I've also pasted the code here in my blog (below, miniaturized).

tell application "Mail"
	set selectedMessages to selection
	
	if (count of selectedMessages) is equal to 0 then
	else
		set theMessage to item 1 of selectedMessages
		
		set theSubject to subject of theMessage
		set theMessageId to message id of theMessage
		set theSender to sender of theMessage

		set message_url to "" & ¬
		"" & ¬
			theSubject & ¬
			""
		
		tell application "Things"
			
		set newToDo to make new to do ¬
		with properties {name:theSender & ¬
		" : " & theSubject, due date:current date, ¬
		notes:message_url} ¬
		at end of list "Mails To Answer"
			
		-- just be sure we register to Grown
		tell application "GrowlHelperApp" to ¬
		register as application ¬
		"Things Integration" ¬
		all notifications {"Mail linked to Things"} ¬
		default notifications {"Mail linked to Things"}
			
		tell application "GrowlHelperApp" to ¬
		notify with name "Mail linked to Things" ¬
		title (theSubject) ¬
		description "Mail linked to Things" ¬ 
		application name "Things Integration" ¬
		priority 0 sticky no icon of application "Mail.app"
			
			
		end tell
	end if
end tell

created on: 8/19/2009 1:40 PM
tags:
apple(6)
hits: 278
comments: (0)
... actually ... my first one that was approved by Apple and got published on the AppStore.
Check it out here: DomainTyper iPhone Application
created on: 4/18/2009 9:11 PM
tags:
iPhone(2)
hits: 356
comments: (0)
i wanted to turn off the deep sleep in mac-os. Here is the script that solves this:

sudo sh -c '
pmset -a hibernatemode 0;
nvram use-nvramrc?=false;
rm /var/vm/sleepimage > /dev/null 2>&1
'
created on: 12/10/2008 12:03 AM
tags:
apple(6)
hits: 601
comments: (0)
Recently I've purchased an iPhone 3G - and despite of all my previous prejudices i have to say that this phone is really good. Actually it's a UNIX based computer with 128MB ram and a 620MHz ARM 1176 cpu underclocked to 412MHz - probably because of stability and power consumption.

We can say that 10 years ago a computer with these characteristics was a supercomputer which sat on your desk and weighted like 10kilos - but now it just lies in my pocket :) ... cool...

So I've decided to find out what it takes to write a simple hello world application for it - but it turned out that i just digged deeper myself into the iPhone development world. (Currently in my free time I'm writing a complex rss reader ...)

Here are the steps required to start developing for iPhone:

1. Download the iPhone SDK. This will lead to step 2 ...

2. Register at http://developer.apple.com/iphone and download the SDK :) - strange enough ... you may download the SDK only if you register on the site .. whatever :) ... i did it.

3. Look at the hardware & software requirements and aknowledge that there is no microsoft windows support for this (which actually makes sence, probably there is no apple tool for developing for windows mobile either ...). So you should... BUY A MAC. I've bought an older mac mini - it has a 1.5GHz intel cpu and 2G Ram - the developer environment runs absolutely fine on it. It looks like this:


4. After you own a mac - you can start developing in Objective-C and test your applications in the iPhone Simulator. cool :) - but you soon will realise that you can not test your application on the actual iPhone device. Why ? Because you have to pay 99$ to Apple for a code signing certificate as iPhone only accepts programs signed by certificates issued by Apple. After this you can upload your application to your iPhone - (unless of course you jailbreak your phone...)

So these are the preliminary steps required to start iPhone developing ... I will explain the 'Hello World' steps in my next post ;)
created on: 11/14/2008 4:04 PM
tags:
iPhone(2)
hits: 695
comments: (0)
WWWWOOOOOOOOOOOOWWWWWWW ! Sysinternals Desktops !!!
http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx
created on: 9/10/2008 1:15 PM
tags:
General(13)
hits: 830
comments: (0)
To follow up on getting bluetooth to work on Ubuntu Hardy, I did this:

1) visit this site, and add the Debian sid repository
Unofficial Debian packages
it is not necessary to add the source repository.

1a) refresh synaptic, and add the package
omnibook-source

2) use module-assistant to build the kernel module 
(but first, exit synaptic)
sudo m-a a-i omnibook-source
(you have to work out how to get module-assistant working
 yourself. It is a package; you can find it in Synaptic. 
Make sure you install all recommended dependencies. 
Try installing build-essential as well)

3) we need to make sure the module loads at startup
so edit the file /etc/modules
sudo vi /etc/modules
and add the line
omnibook
at the end

4) and we need to get it working so make a file called 
omnibook in /etc/modprobe.d
and in this file put one line
omnibook ectype=14

5) you don't need to reboot. You can do this
sudo modprobe omnibook ectype=14

by doing this, the bluetooth icon appears.
I just synced my phone. It works very well. 


Source: http://www.linuxforums.org/forum/ubuntu-help/125492-solved-problem-bluetooth.html
created on: 9/9/2008 8:48 PM
tags:
linux(4)
hits: 943
comments: (0)
These days I've bought a software, AllwaySync (http://allwaysync.com/) to easily synchronize my laptop's data to my central NAS device at home. It is a really handy piece of software but it is a big pain in the ass to allways manually start the synchronization - so I've figured out how to schedule a task in Windows Vista on the event of connection my laptop to a specific WiFi network.

So here are the rough steps you need to do. Start event viewer and go to the Microsoft-Windows-WLAN-AutoConfig/Operational log and check for the events with the ID 8001. These events are logged when the WiFi connection is up & running - and it contains all the information on the WiFi network. Here is how it looks like:
WLAN AutoConfig service has successfully connected to a wireless network.

Network Adapter: Intel(R) Wireless WiFi Link 4965AGN
Interface GUID: {40a3c36f-e20e-4875-b4be-db61787a5fe3}
Connection Mode: Connection to a secure network without a profile
Profile Name: ExternalDevices
SSID: ExternalDevices
BSS Type: Infrastructure
BSSID: 00:1C:57:43:14:11
PHY Type: 802.11g
Authentication: WPA-Personal
Encryption: TKIP
802.1x Enabled: No
Now the nice thing about the new event viewer is that it can give you an XML representation as well of this event:
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Microsoft-Windows-WLAN-AutoConfig"
 Guid="{9580d7dd-0379-4658-9870-d5be7d52d6de}" /> 
  <EventID>8001</EventID> 
  <Version>0</Version> 
  <Level>4</Level> 
  <Task>0</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x8000000000000000</Keywords> 
  <TimeCreated SystemTime="2008-09-03T08:13:56.216Z" /> 
  <EventRecordID>6497</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="12" ThreadID="14812" /> 
  <Channel>Microsoft-Windows-WLAN-AutoConfig/Operational</Channel> 
  <Computer>sparky</Computer> 
  <Security UserID="S-1-5-18" /> 
  </System>
- <EventData>
  <Data Name="InterfaceGuid">{40A3C36F-E20E-4875-B4BE-DB61787A5FE3}</Data> 
  <Data Name="InterfaceDescription">Intel(R) Wireless WiFi Link 4965AGN</Data> 
  <Data Name="ConnectionMode">Connection to a secure network without a profile</Data> 
  <Data Name="ProfileName">ExternalDevices</Data> 
  <Data Name="SSID">ExternalDevices</Data> 
  <Data Name="BSSType">Infrastructure</Data> 
  <Data Name="BSSID">00:1C:57:43:14:11</Data> 
  <Data Name="PHYType">802.11g</Data> 
  <Data Name="AuthenticationAlgorithm">WPA-Personal</Data> 
  <Data Name="CipherAlgorithm">TKIP</Data> 
  <Data Name="OnexEnabled">0</Data> 
  <Data Name="ConnectionId">0xe</Data> 
  </EventData>
  </Event>


So you need to fire up Task Scheduler, create a new task, and in the triggers you should choose to run this task on a new event and use an XPath that matches the event that is logged. Here it is my version of the XPath that matches the event with ID 8001 and the Wifi network with the name: 'hostingabc.hu':
XML
1
2
3
4
5
6
7
8
9
<QueryList>
  <Query Id="0" 
Path="Microsoft-Windows-WLAN-AutoConfig/Operational">
    <Select Path="Microsoft-Windows-WLAN-AutoConfig/Operational">
		*{System\{(EventID=8001)}} and
 *{EventData{Data{@Name="SSID"}='hostingabc.hu'}}</Select>
  </Query>
</QueryList>

Note: I have a bug in my colorer and it does not handle the square bracket characters so I've replaced them with curly braces :) - just be sure you replace them to the proper square brackets.
Enjoy :).
created on: 9/3/2008 1:51 PM
tags:
Vista(3)
hits: 910
comments: (0)

http://www.wl500g.info/showthread.php?t=15575

Since the existing automounter supports only hard disks to be mounted - i needed a solution for automatically mounting cd filesystems. So the solution is to cross compile automount and to include autofs4 & /proc support into the kernel. If you want to try it follow these steps: 0. download these files: http://www.moszi.net/dev/automount/automount.tar.gz 1. insmod autofs4.o 2. ln -s /proc/mounts /etc/mtab (this will only work if you recompiled your kernel with /proc support) 3. copy the necessary files to their places 4. edit your /opt/etc/auto.misc file 5. start /opt/etc/init/S97autofs Enjoy

created on: 8/24/2008 10:57 AM
tags:
router(6)
wl500g(6)
hits: 888
comments: (0)
When I bought this router I really did not realize that it will open a whole new world to me ...
For a long time I wanted a NAS (Network Attached Storage) device so I can keep my files in a centralized way, but the price of these devices always was so high that it kept me away from buying one ...

So when I've found out that this router has 2 USB ports and that a custom firmware can be installed on it to support additional services I decided immediately that I'll buy one of these small wonders :) ...
On the very first day I've installed Oleg's custom firmware and started digging into the firmware. It comes with a balanced set of features, it has telnet, ssh, ftp, samba, and other goodies that you might need. So it was perfect.

However over the years the loss of several hard disks - which obviously resulted in quite a few times loosing my precious data - convinced me that I simply need a RAID set to protect my data.
As the custom firmware does not support RAID sets I downloaded Oleg's sources for the firmware and rebuilt it adding a few other things that i found necessary ;)
This way i have:

* RAID1 support in the router (and have 2 hard disks linked in one array)
* CD/DVD support
* automount support
* wtmp support (to have historical track of logins)

Other stuff on the router:
* there is a cool script which periodically checks for brute force attacks and denies the source IP of accessing the router anymore.
* there is a torrent client with web based UI
* lighttp with php support can be installed on it, and can be used to stream all your music (using with Winamp + Bento skin's browser works like a charm!)
* there is mini-sendmail to send notifications to yourself anywhere you are ..

Hardware 'upgrades':
I've opened the box and installed a card reading into it and plugged a 4GByte microdrive so I will have a persistent 'hard disk' in the router - and in the next couple of days I will install 128MB of memory (instead of having only 32M ...). { I will keep you posted about this ;) }

Bottomline: if you need a stable and really good router, by this one.
created on: 8/20/2008 8:26 PM
tags:
router(6)
wl500g(6)
hits: 991
comments: (0)
http://wl500g.info/showthread.php?t=15550

Hi Everybody, I'm using Oleg's 1.9.2.7-10 firmware for 3 months now (on a WL500gp) - thanks Oleg - and it is really great, it works just perfectly ! Since I do not have a desktop PC at my home - I only use a notebook - I really wanted to create a redundant way for storage and because I'm using Xbox for media playing I wanted an external DVD reader to be attached to my router so I can access all my DVD's through samba from my xbox. To achieve this I recompiled Oleg's firmware to include SCSI emulation for IDE/ATAPI CDROM & to include RAID support in the kernel. If you don't want to recompile the kernel yourself these are the steps to achieve both functionalities: CD-ROM: 1. insmod cdrom.o 2. insmod isofs.o 3. insmod sr_mod.o (it might be that the order is not this one, I'm writing this from my head) at this time your cd device will appear under /dev/scsi/... RAID1: 1. insmod md.o 2. insmod raid1.o after this you can create your RAID1 soft array using mdadm. LVM is not needed. Note1: Because the 2.4 kernel contains a bug in md.c you need to replace this file with the correct one (this is described here: http://wl500g.info/showthread.php?p=100925 and it works perfectly when you recompile the kernel) If you need help with this, just contact me. PS. (offtopic) I've a USB hub with 6 USB ports attached to one of the USB ports on the router. This has 2 hard disks linked in a RAID1 array + the DVD reader. This works as intended - no special drivers were needed to support this. The second USB port on the router has attached a 6 in 1 card reader with a 4GByte CF Microdrive. This works as a charm as well

created on: 8/8/2008 7:47 PM
tags:
router(6)
wl500g(6)
hits: 956
comments: (1)
http://wl500g.info/showthread.php?t=15552

These days I've spent some time figuring out the structure of the firmware sources - here are my finding on how to recompile it: 1. Since I use Vista, I downloaded an Ubuntu image for vmware player - i did all the firmware compilation in this virtual machine 2. downloaded the asus firmware, oleg's firmware additions and the uclibc toolchain. these are the items you need to recompile the firmware. 3. I've made a nice script that uncompresses all these packages, applies Oleg's patches on the firmware, and applies some additional minor changes to the source tree. You can download this package from this location: http://www.moszi.net/dev/download/wl500g-source.tar.gz The script you should run is : createBaseFirmwareSources from the binaries folder. (cd to this folder, otherwise it will not run correctly) Also please note, that my own patches are located in the patches folder. Currently only 3 minor changes: 1. correcting the raid1 CRC bug (md.c) 2. wide character support in uClibc 3. Makefile for oleg's patches in order to allow wtmp usage in dropbear (i didn't succeed with this one yet) Have fun, if you need help, contact me.

created on: 8/8/2008 7:46 PM
tags:
wl500g(6)
router(6)
hits: 956
comments: (0)
These days I was playing around with powershell - and it proved itself quite useful. I already have several backup scripts, defragment & anti-virus check script on my server.
So on top of all this coolness :) this is very cool indeed as well:
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<html>
  <body>
    <table>
      <tr><td>ID</td></tr>
      <% get-process | foreach { %> 
        <tr>
          <td><%=$_.ID%></td>
          <td><%=$_.ProcessName%></td>
        </tr>
      <% } %>
    </table>
  </body>
</html>

Take a look at this link: http://blogs.msdn.com/powershell/archive/2008/07/18/powershell-asp-too-cool.aspx
created on: 7/23/2008 1:03 PM
tags:
General(13)
hits: 951
comments: (0)
If you've ever wondered how could you list all your usernames and passwords that are set on the 'Directory Security' tab on each website's properties (in inetmgr) then this small C# code snippet would be for you ..
Just a note: so far it seems that this code snippet works only on Windows Server 2003 - i have no ideea why doesn't it work on XP / Vista as well (don't care actually :) - i needed it for win 2003)...

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
static void Main(string{} args)
{
    DirectoryEntry iisBase = new DirectoryEntry("IIS://localhost/W3SVC");
    PrintUserNameAndPass(iisBase);
}

private static void PrintUserNameAndPass(DirectoryEntry iisChild)
{
    String userName = null; 
    String password = null;
    
    if (iisChild.Properties{"AnonymousUserName"} != null)
    {
        userName = iisChild.Properties{"AnonymousUserName"}.Value as String;
    }
    if (iisChild.Properties{"AnonymousUserPass"} != null)
    {
        password = iisChild.Properties{"AnonymousUserPass"}.Value as String;
    }

    if (userName != null && password != null)
    {
        if (!userNames.Contains(userName))
        {
            byte{} passwordChars = ASCIIEncoding.ASCII.GetBytes(password);
            Console.WriteLine(String.Format("{0}\t{1}", userName, 
              System.Convert.ToBase64String(passwordChars)));
            userNames.Add(userName);
        }
    }

    foreach (DirectoryEntry newChild in iisChild.Children)
    {
        PrintUserNameAndPass(newChild);
    }

    iisChild.Dispose();
}


Update: Actually I've found out that the exception on Windows Vista was caused by the lack of IIS6 compatibility module. So I've just had to install this compatibility module from Windows features and everything works as expected.
created on: 7/2/2008 9:10 AM
tags:
IIS 6.0(1)
hits: 980
comments: (0)
created on: 6/27/2008 10:24 AM
tags:
humor(1)
hits: 973
comments: (0)
Pages:01>>
add linkThe last comments:Afonso says:I'm trying to make a raid1 on the asus 500gp and I've saw your thread. But I cannot find the md.o and the raid1.o on modules.tar.gz file you attached. I also have a linux noobie question here should I put the files to make the insmod command see themmike says:Good videosmoszidev says:Venemo: it is at System.Web.Configuration.HttpConfigurationSystem.UseHttpConfigurationSystem moszidev says:dumb, ... no wonder your name is dumb :) ... i more or less expected these type of answers :) - trust me, i know the double locking design pattern :) ... but it seems that you don't really know for what the locking is needed ;) ...dumb says:this is called double locking: http://en.wikipedia.org/wiki/Double_checked_locking_patternVenemo says:Where did you find this in the framework?moszidev says:just found out that the maximum transfer rate on USB or UTP for this router is 3.5MBytes/sec. (that is 28MBit / sec)[br] So if you have a connection speed higher than this, it will not be fully used for sure.
Copyright (C) 2007, Molnar Szilveszter m@il me