Note: This method has been deprecated with the release of WordPress 3 – in Ubuntu/Debian, you now only need to run the following as root:
apt-get install libssh2-php apache2ctl -k graceful
And you’re done!
Note: This method has been deprecated with the release of WordPress 3 – in Ubuntu/Debian, you now only need to run the following as root:
apt-get install libssh2-php apache2ctl -k graceful
And you’re done!
My friend Danny is a systems administrator and all-around IT guy at a manufacturing company in Indianapolis. He recently came up with a pretty useful little script, and wanted me to pass it on to the world.
Recently I needed to find out which folders a certain person was able to access on our Windows network. Apparently, this was extremely easy in Novell. Since it isn’t 1995 anymore, I tried to find a way to do this on the Internet. I couldn’t, so I set about making my own.
Microsoft has a utility called xcacls.vbs (if you’re using Vista, you’ll have to make sure WMI is installed, and modify the script. If you can’t do that comfortably, you probably don’t want to be messing with the rest of this anyway). It will allow you to change and view ACL’s from a command line. Since I’m not that interested in modifying the ACL’s in a script, the usage is fairly simple “xcacls c:\windows” will result in a listing of who has entries in the ACL and what the entry is (n.b. you’ll also have to have the default script host be cscript. Wscript won’t work).
In order for this to be useful, we really need to be able to have it run automatically on several, if not all, folders on a computer. The first step would be to get a list of the folders we want to run this on. I chose to limit it to one folder and all its subfolders only (c:\ will do everything, while c:\windows will only do the folders in c:\windows. If you want to do c:\windows and c:\program files only, you’ll have to run it twice).
What I was looking for was basically a text file that just had all the folders. This command will create exactly that:
dir "c:\program files" /s /b /o:gn /a:d > c:\batch\xcacls\dirlist.txt
Now that we’ve got a list of all the folders we need to search, we need to actually loop through it.
For /F "tokens=*" %%i in (dirlist.txt) do c:\batch\xcacls\aclSearch.bat administrator %%i
C:\batch\xcacls\aclSearch.bat is another batch file which takes two parameters (I’ll show you it in a minute). I call the other batch file so I don’t have to worry about how DOS handles variables (it doesn’t like to evaluate them during runtime, and will wait until the loop is done and use the final value for each iteration. It’s weird, I know).
A caveat about the for loop: when using for in an interactive CLI you use a single % sign in front of the i, when using it in a batch file, it’s a double %. Don’t ask me why.
aclSearch.bat contains the following
call c:\batch\xcacls\xcacls.vbs "%2" > c:\batch\xcacls\xcaclsResults.txt find /i %1 c:\batch\xcacls\xcaclsResults.txt if %errorlevel%==0 goto Found goto End :Found echo %2 >>c:\batch\xcacls\%1results.txt :End
This calls xcacls.vbs (from Microsoft) passing it the folder name. The quotes are there to handle filenames with spaces. It then sends the results into a temporary file called xcaclsResults.txt
Next we do a find using the search string (the first item passed – administrator in this example) on that file. If Find finds a match, the errorlevel is 0; if not, it is 1. If the errorlevel is 0, then the folder name is put into a results file named whatever the search string is, with results.txt appended (in this example it’d be administratorresults.txt).
So, how do you actually use all this? FindPermission.bat contains:
dir %1 /s /b /o:gn /a:d>"c:\batch\xcacls\dirlist.txt" for /F "tokens=*" %%i in (dirlist.txt) do c:\batch\xcacls\aclSearch.bat %2 %%i
To search the c:\program files directory for anything the administrators group has access to you’d type:
Findpermission.bat "c:\program files" administratorsThe results will be in the same folder you ran findpermissons from and be called administratorsResults.txt. To search the C drive for anything Danny Parrott has access to, you’d need:
Findpermission.bat c:\ "Danny Parrott"The results from this one will be in Danny Parrottresults.txt.
This does require that Findpermission.bat, aclSearch.bat, and xcacls.vbs be either in the same folder, or in a folder that’s in the path variable. It will work for either users or groups. This process is also not instantaneous. The xcacl.vbs script can take upwards of half a second to run, so on larger systems, this is something you’d want to start and come back to later. On the plus side, though, it hardly uses any system resources while running (5MB RAM and 2-4% CPU time on a four-year-old server at work) so you can run it during the day.
So Firefox 3.0 was released recently. I downloaded it today to see if it was worth upgrading from 1.5 (I skipped 2.0 entirely – too many annoyances for me).
The verdict thus far is, as I used to say when I was 15, “big negative on that one”.
I really don’t see much happiness in the future of Firefox. What I see is yet another great piece of open source software going drastically downhill in an attempt to “reach out” to a wider user base – meaning a dumber user base.
There is a delicate balance between making an app so unusable that nobody downloads it (even though you, as the developer, might find it plenty useful) and making an app so dumbed-down that anyone, including a computer-illiterate 90-year-old, can use it. This is particularly a problem with open-source software.
I’ve been a big fan of how Microsoft does things. I’m sure I’ll get blasted by “real geeks” for saying that, but the fact is, Microsoft’s products cater to everyone – from the stupidest of the stupid users to the most advanced power-using geeks out there. While there are certain things that Linux indeed does better, Windows meets all of my needs as a power user – and all of my mother’s needs as someone who only uses the computer for email and the occasional game of Spider Solitaire.
In the case of OSS, it’s too easy to either make a product really dumbed-down or really complex. This is more or less what happened when Gaim was released as Pidgin several years ago. Since then, Pidgin’s development has gotten drastically more user-unfriendly in an attempt to make it more accessible to people who would otherwise avoid unfamiliar software. In the case of Pidgin, as “features” were added (which translated into actual features being removed, hidden, or dumbed down) and the user base got wind of the changes and requested fixes or reversions, the developers unfortunately were not too interested in listening to their users.
Firefox is a much bigger open-source project compared to Pidgin, which makes me wonder if they’ll be less likely to listen to their users – or more likely because they have such a public presence now. It’s hard to tell, really.
Surprisingly, Firefox 3.0 has made an effort to behave more like Internet Explorer – I tend to believe it should be the other way around. The oversized back button just gets in the way – who even uses the back button anymore? Ctrl+Left is a heck of a lot faster when navigating your page history.
Not only that, but, like IE7, FF 3.0 has condensed the history into a single button. Rather than having arrows next to both back and forward so that you can navigate in either direction in a tab’s page history, it’s all been shoved into a single button. Does this actually increase usability? I tend to think not. When you’re doing a lot of heavy browsing (and lord knows I do that enough), you don’t want to try and work with one list for all your page history – it’s easier when it’s split between what’s behind and what’s ahead in your page history.
The new drop-down URL bar is ridiculously obnoxious. I Googled around a bit to see what others thought, and there’s a pretty clear consensus so far – the new auto search is annoying, frustrating, and at times unusable. While I’m sure there are people who only remember URLs by title, I don’t. I know the actual URL. When I type in “sla” to go to slashdot, I’d rather not have it start throwing back search suggestions and entries from my history or my bookmarks. If I want to find a page in my history, I’ll hit Ctrl+H and search for it in the History sidebar.
I would imagine that this particular problem, given how many people already dislike it, will be fixed soon with an extension.
Then we come to the feature that I was most interested in – memory management. I am a tab addict. On any given day, I’ll generally have between 20 and 40 tabs open in a single Firefox window. On top of that, each tab has enough browsing history that I start to quickly suck up any and all available physical and virtual RAM as Firefox attempts to cache my history in RAM. After a few days of leaving my workstation at Purdue up and running with Firefox open, I’ll look in the task manager to discover that Firefox is using 500MB of RAM (out of 2GB) and another 1.2GB or so of virtual memory. Closing tabs doesn’t fix the problem – the cache is still there. Killing the process entirely and starting over is the only way to free up memory.
I haven’t really put FF 3.0 through the wringer yet on this one. However, in running the same general activities in 1.5 and 3.0 today, both were using almost identical amounts of physical and virtual memory. It’s not a good sign so far, but I’ll have to really do some hardcore browsing to see if 3.0 is actually an improvement over previous releases.
So far, 3.0 has not impressed me. The only feature I’ve seen so far that I liked was the ability to make it remember to always allow SSL certificates with mismatched domains – at work, our development environment’s SSL certificate doesn’t match the server’s URL. It gets annoying to get that “are you sure you want to do this?” popup every time I login (particularly when the login has to expire after an hour). Being able to set it to always authenticate without needing an extension is nice.
Other than that, though, I think I’ll be sticking with 1.5 for awhile longer, much like I’ve been forced to use older versions of Pidgin to compensate for the fact that the developers appear to be writing the application into its grave.