We all know what a useful tool the Windows System Restore Point can be for fixing problems that inevitably crop up from time to time, and we also know what a pain it is to create a System Restore Point manually just for good measure. So, let me share with you this application that I found a while back and have been using and testing called (aptly enough) Restore Point Creator! This tool is way cool to have around because it make creating System Restore Points quick and easy, and gives you a look at the list of your most recent Restore Points, when they were created and so on. Best of all, aside from it’s most useful features, it is completely free of charge though a donation to the author wouldn’t hurt your karma any. Check it out and see what you think for yourself.
Here recently I have been working more and more with Visual Studio again, and more specifically the Color Picker / Color Dialog control. For my purposes, I wanted the user to pick a color, and that color to then populate a text box in the form of an HTML compliant hex value, in other words, I need the result from the color picker as a string. Now, in VB.NET 2010 which is what I am using, the result from the color picker is in a format that is primed and ready to apply to a control, to change its fore or back round color. It does not give you a value in string format. So, I had to do a good bit of searching and work to figure this out.
Basically, what I ended up with was a function that you run the color picker response or value through. It’s pretty simple really:
Public Function Color2Html(ByVal MyColor As Color) As String Return "#" & MyColor.ToArgb().ToString("x").Substring(2).ToUpper End Function
That’s it, that will return to you a hex color code formatted for HTML use. Just in case you are unsure of exactly how to use the function, this is the code I use with my color picker control (I use a standard button to fire it off with the result going into a text box):
Private Sub btnColor1_Click(sender As System.Object, e As System.EventArgs) Handles btnColor1.Click Dim NewColor As New ColorDialog() NewColor.AllowFullOpen = True NewColor.ShowHelp = True If (NewColor.ShowDialog() = Windows.Forms.DialogResult.OK) Then txtColor.Text = Color2Html(NewColor.Color) End If End Sub
That’s all there is too it. I hope this helps you get your string data from your Color Dialog / Color Picker control. Enjoy!
Hey folks, here’s a fun little tidbit for you. Did you know that you can easily and quickly encrypt and decrypt files using one tiny little command on your super cool Linux or UNIX (Yes, OSX counts) and even Windows command line? For those that haven’t yet heard of it, it’s a command called ‘ccrypt‘. Check it out …
First we need to install ccrypt on on your system. For Debian and Ubuntu (which is based on Debian), you can simply use the apt package manager to do this. Remember that you can use the -s flag to test or simulate the install before you actually go through with it in order to make sure there are no surprises waiting for you. Logged in as your un-privileged account, the command would look like this:
sudo apt-get -s install ccrypt
Assuming everything went off as planned, you could then run the real thing:
sudo apt-get install ccrypt
For Redhat (CentOS, and others based on Redhat), they have RPM packages available for download. Along with those they have Debian, Solaris (SPARC and i386), OS/2, SuSE, OpenBSD, and FreeBSD packages as well as pre-compiled binaries for lots of platforms and OS’s, so go crazy people!!
OK, now that you have the package installed, you can have some fun whiling away the afternoon encrypting and decrypting files like mad!
To encrypt a file, run this command:
It’s just that easy.
Naturally, you would replace ‘file_name’ with your real file information. You will be asked to enter a key or password two times. Once complete, the encrypted file will have an extension of ‘.cpt’, and the original un-encrypted file will be replaced by the encrypted file.
To decrypt the file, run the same command the same way and simply add the -d flag.
ccrypt -d file_name
You will be asked for the encryption key or password that you gave it when you encrypted it in the first place, so don’t lose it! As always you can use the ‘–help’ flag or hit up the man pages for more detailed information. Hope you enjoy it!
**Danger, Will Robinson!**
Cheesy I know, but I hope it’s working. One more time – please note that when you run the command to encrypt a file, the original source file, the un-encrypted file gets replaced by the newly encrypted file. So if you are simply making an encrypted copy for example, the original is gone. If you lose or forget the encryption key or password you will be out of luck. I’m sure it can be cracked by someone, but boy that would be a pain in the arse! So, keep that in mind when you encrypt a file, the file you are encrypting goes bye, bye! It works the same way when un-encrypting, but that’s not as potentially dangerous.
OK gang, this is a nice one that I have to share with you. If you are a command line junkie like me and are stuck not only in a Windows GUI infested world, but in a world where the Linux distro’s seems to be more and more inclined to head that way too, you might just love this tool. Now, this is Windows only but may run on WINE as well, I haven’t tried it yet but I will do that and report back later.
Anyway, the software is called Take Command, and the beauty of it is that it allows you to run a very sweet console window that is built in, with all kinds of built in variable and functions that makes this thing seem kinda like bash for Windows on crack or something. However, even better is that you can run other console windows of your choosing, right along side the original one all in a nice tabbed interface! What does that mean exactly? You may be asking. Well, check this out: all in one interface I myself have the standard Windows Command Prompt, a BASH shell from Git, a Windows Powershell window, a CYGWIN window, and the customized TCC prompt!!! And I can add more, up to 25 console windows! You just point to the executable to run in that console and away you go, it’s awesome. Now I don’t have to have a bunch of separate windows open, I just have one, that re-sizable, adds copy and paste, and more! One more thing, the way that this software hosts the command console executables (think cmd.exe), it runs it way faster than when running natively! The I/O is awesome! I’m not sure what kind of voodoo the author came up with to make Windows faster but I don’t care, I dig it!
For even more goodness, I mentioned earlier that the app adds more commands (140) and more functions and variables (450) and literally thousands of additional features to the Windows Command Prompt. So, if you are a Windows admin, this tool will really shine for you with their advanced bath file and scripting capabilities, additional features, speed and more. I highly encourage you to watch this video here on the left, it’s short but gives you a quick rundown of the high points of this software. It can do so much and has so much in it, I cannot possible talk about it all.
Now for the bad side, and that is that the tool is expensive, it’s not cheap. We are talking about $99.95 for a license, which isn’t the end of the world but it can be a lot for a sysadmin’s budget. However, it is worth it, and further more, if you are patient, you can find a good deal on it at Bits du Jour. If my memory serves me correctly, I think got my copy for about half price. All in all though, like I said, if you are a command like junkie or warrior, this tool will not only save you time and effort, it will look way cool in your kit too! I use this tool every day and I love it.
One last this, this little gem of a tool will be listed along with all of the other Cool Tools in the list, so when you are done checking this tool out, why don’t you go see the list and check out the rest of the Cool Tools!
*As usual, I want to remind everyone that I am not affiliated with jpsoftware in any way and I get nothing from recommending this or if you buy it, I am telling you about this because I like it, and I think it will be beneficial to other IT warriors out there like me!
Here’s a quick tidbit for any and all Windows jockeys out there. Need to figure out what is chewing up all of your system resources? Need to do it quickly and easily? Have no fear, Laz and the PowerShell are here. Some of you may know this already, so let those who don’t have some air!
OK, bring up the PowerShell (*note, this is different from the DOS “like” Command Prompt and can usually be installed through Windows Update). Once the PowerShell is open, you can use the ‘ps’ command to get a list of the currently running pr0cesses, but believe you me there are a lot of them and they scroll by all unformatted and hard to read and stuff. All in all you get a bunch of info that is hard to understand!
“So, what are we doing here?” you ask. Well, this is where just like with the ‘ps’ command (and the PowerShell in and of itself too), Windows takes some inspiration from UNIX and not only adds some nifty commands to help wrangle all that information that goes scrolling by, but also the idea of “piping” commands or a more simpler analogy, a way to link commands together. Making them talk to each other, work together and share information like never before. You pipe commands together with the ‘|’ character, and it allows you to run a command and take that output and send it to the next command. You will see this in the final command we will use, take a look:
ps | sort -desc cpu | select -f 20 | ft -a;
So, let’s take a look at what this command or set of commands really, does. First off the ps command gets the current list of processes running on the machine along with certain information about each and every one of them like the ‘Process ID’, the ‘ProcessName’ and the amount of ‘CPU’ time it’s using to name just a few. We then take all of that ‘ps’ data and “pipe” or feed it into the ‘sort’ command, telling sort to … well, sort that information by the ‘CPU’ column in “Descending” order. We then take all that sorted data and use the ‘select’ command to only grab or select the top ’20’ items in the list. Last but not least, we use the ‘ft’ command to “format” the list that we have now, which has been cut down to just the top 20 processes sorted by how much of your CPU they are using starting with the most at the top of the list and then listing the top 20 going down from there.
Ultimately, you run this command just like you see it above and you will get a list of the top processes that looks like this:
PS C:\temp> ps | sort -desc cpu | select -f 20 | ft -a; Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 197 14 6700 11456 92 1,008.66 2744 AODAssist 422 15 6272 11572 53 886.27 1112 svchost 2398 1032 115224 10804 420 863.37 2020 AvastSvc 827 48 253744 247248 371 641.55 1388 svchost 1132 106 86252 118472 421 575.07 3596 explorer 140 69 45028 49456 173 572.51 5012 Everything 485 47 46612 69228 284 565.83 9608 explorer 1535 90 33912 49260 433 453.93 1460 svchost 717 52 29416 27460 124 451.45 1352 svchost 363 43 41048 11472 176 370.32 4436 svchost 909 63 94836 129776 726 366.38 6388 dopus 596 54 24476 26196 248 364.06 5136 avastui 684 44 22172 23564 241 352.66 1048 svchost 140 13 119472 113980 183 328.48 6972 vmware-usbarbitrator64 300 13 9940 14796 64 306.90 6516 WmiPrvSE 346 31 35176 29280 203 302.42 4688 tlbHost 225 24 1431016 1339160 1460 263.47 1500 stacsv64 865 81 27488 36708 149 216.86 1420 svchost 202 16 7300 15020 96 215.45 1744 WHSTrayApp 110 10 7144 10368 58 200.74 3252 BitMeterCaptureService
There you go, a nice handy little list of your top offenders! If you keep a PowerShell handy, it can be a very fast way to take a quick look at what’s going on under the hood of your PC. Enjoy!
Whoah! We have been busy, busy over here setting up a bunch of new advisory pages. Just in case you are wondering, we take an RSS feed and set it up to display on a page. So, you can click on that page link and get the latest information from that RSS feed right there on the page here at Solarum dot com. We have many of the major feeds that IT folk would be interested in, from Microsoft and Cisco security advisories to Linux and UNIX as well. We even include feeds from NIST, US Cert, OSVDB and more so we can keep an eye on apps and everything else too. Not to mention that we add feeds any time we can, and especially when we find good information to share. Enough talking, why don’t you go check them out, they are in the middle column near the top, all the information you need! If you know of a feed that we should carry, please let us know so we can add it!!