November 16
2008
Dan Qing non proferì parola.
«Significa: “Il diritto estremo è estrema ingiustizia”» concluse Metello. E uscì. L’Impero dei Draghi
Have you ever needed to execute a command (such as application, batch, script, etc.) on your server with administrator privileges?
Asp.net provides impersonation, that can be used to execute a piece of code with arbitrary credentials, but after examining a little the situation, i’ve came up that is not a good way for me; for various reasons, maybe the more importantly is that the LogonUser method used by impersonation requires that you use a password and that password has to come from somewhere. This means somewhere in your system you have to store this password and retrieve that password which can be compromised and then potentially be used to further penetrate security.
So i’ve implemented another simple method to obviate to this: basically a Windows Service installed on the server machine, running as administrator (or the preferred account), listening for the ServiceBase.OnCustomCommand method, which is invoked by an asp.net page by the ServiceController.ExecuteCommand method. The IPC (Inter-Process Communication) is implemented with a file, written by the asp.net page and read from the windows service, and that contains the command to execute.
Continue reading »This simple utility, written in C# .net, provides some useful tools for blog posts editing - or other general needs:
Scenario: Windows server machine with one or more folders that daily receive backup files from different client machines, within a defined (and configurable) time interval, and after receiving all the archives from all client machines must be shutdown automatically.
Continue reading »In this article i’m going to explain a recently backup plan i’ve implemented for my company.
The backup plan refers to a single Linux client machine which sends backup data to a backup server, but it can be straightly applied to an arbitrary number of client machines. After a quite extensive search over the net i’ve decided to implement the backup plan using dar - Disk ARchive to actually make the backups and rsync to ship data to the backup storage remote server.
I’ve chosen dar as backup software because i’ve found it enough simple to deploy and at the same time plenty of features; and i’ve chosen rsync to transfer data because of it smart file transfer: rsync uses the "rsync algorithm" which provides a very fast method for bringing remote files into sync. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one of the ends of the link beforehand.
dar is executed:
After successful backup rsync is invoked to transfer data to the backups storage server.
Sysadmin notifications: backups scheduling is done by using cron, so i’m using the cron built-in feature which sends the output of executed commands via mail.
Continue reading »
Set your favorite Simpsons character as your Today background on your Windows Mobile based device!…
Available characters:
Continue reading »
Any donation is appreciated, consider a €1 donation for each download (or maybe €1.35 since PayPal takes €0.35 from a €1.00 donation). Your support allows me to continue to create free software.