Cheap Macbook Pro Docking Solution for about $30
I typically prefer developing on my desktop and large dual screen monitor setup as opposed to my Macbook. Recently, I’ve gotten into more PHP development and developing on the Mac is proving to be a more enjoyable experience only because Windows is still a second class citizen for most PHP libraries/tools. I still wanted a larger screen setup, so I considered buying a docking station to hook up to a larger monitor but I soon learned they feature the ‘Mac Penalty’ in that they cost more than they should just because it’s for Apple products.
I already have two large monitors and figured my Macbook could serve as third screen. Then I did some thinking and realized I could use one of the monitors for both computers. Assuming you have two HDMI screens already hooked up to your desktop, this would save you $150+ and still allow you to be more productive.
- Get a copy of Synergy (http://symless.com/) for $10. It’s open source and can be built if you have the time, but a one time fee of $10 saves me the hassle of doing so. With this, you can share your desktop keyboard across all your computers with the one license and it’s cross platform so Linux support is included too.
- Purchase an auto HDMI switcher. I purchased the PORTTA PET0301S 3×1 Port HDMI Switch/Switcher for about $9.
- Be sure to get 2 HDMI cables if you don’t already have them on hand. I don’t like the Amazon Basic brand for these as I’ve had problems with the Mac and those cables hooking up to larger screens.
- Install Synergy on the desktop as a server. Install on the Macbook as a client and it should autoconnect.
- Plug the HDMI cable from the computer into the HDMI switcher, and plug the spare into the Macbook pro. Plug the “Out” end into the monitor.
When you plug your HDMI cable into the Macbook, the HDMI switcher will automatically switch to it and project the Macbook. Synergy will auto-connect as long as it’s running on both and you can share the mouse and keyboard between both and work seamlessly.
If you have an iPad and want to turn that into an additional screen, grab a copy of Duet Display on your desktop/Macbook and install on your iPad for $15.99, and viola, instant portable second screen!
How to Copy and Paste into the Digital Ocean VNC Console
I recently signed up for Digital Ocean to test droplets for my development and linux management testing. I was securing the server and setup fail2ban, disabled the root login, and created a user account but forgot to change the user name from root to the user name I selected in my SSH client profile. I ended up locking myself out of the server and had to resort to logging into the admin panel on Digital Ocean’s website and use their browser embedded VNC client to restore my access. I quickly discovered that one of the downsides of using this panel is that you can’t copy and paste commands. Luckily there’s a workaround and you can use the browser console to do sendkeys through Javascript.
Bring up the console in the browser developer tools. Here’s a cheat sheet for keyboard shortcuts:
Browser | Description | Windows | Mac |
---|---|---|---|
Chrome | Open Developer Tools and bring focus to the console | Ctrl + Shift + J | Cmd + Opt + J |
Firefox | Open Console | Ctrl + Shift + K | Cmd + Opt + K |
Internet Explorer | After hitting F12, you have to click the console tab. There’s no direct shortcut to the console tab. | F12 | N/A |
!function(){function t(){window.rfb.sendKey(e.shift().charCodeAt()),e.length>0&&setTimeout(t,10)}var e=prompt("Enter text to be sent to console").split("");t()}();
Update 9-21-16
Ruden and Sebastiaan’s pointed out there was a bug in the code above. This updated snippet has support for characters when using shift characters like !@#$%^&*()_+
!function(){function t(){function n(t,e){s=s.concat(RFB.messages.keyEvent(t,e))}var o=e.shift(),s=[],i=o.charCodeAt(),c=-1!=='!@#$%^&*()_+{}:"<>?~|'.indexOf(o),r=XK_Shift_L;c&&n(r,1),n(i,1),n(i,0),c&&n(r,0),rfb._sock.send(s),e.length>0&&setTimeout(t,10)}var e=prompt("Enter text to be sent to console").split("");t()}();
You’ll receive a dialog prompt to enter the copy to paste in. Please note that you need to click on the VNC console and hit enter to execute the command.
If you need to enter more than one command, just hit the up arrow on your keyboard in the console to get the script again for easy reuse.
Steam is having trouble connecting to the Steam servers.
If you use Steam and  suddenly find yourself unable to connect receiving the error “Steam is having trouble connecting to the Steam servers.”, check and see if you have Peerblock installed and running. I wasted a lot of time trying to figure out why the connections wouldn’t go through and finally went through apps running in the background one by one, until I closed Peerblock and discovered Steam suddenly started working. If you would like to continue to use Steam while Peerblock is open, follow these instructions for a workaround:
1. Start PeerBlock
2. Click List Manager
3. Click Add
4. Put something in the description like steam-allow
5. click add url and paste this: “http://list.iblocklist.com/?list=steam” (no quotes)
6. Choose type: allow
7. Click Ok then close the List Manager.
This will download a list that adds exceptions for Steam and should let you connect with no issues.
Visual Studio 2013 package did not load correctly
Today I loaded up Visual Studio to continue work on a project and created by a random bunch of errors. All were complaints that various packages could not be loaded. The one I captured was:
[alert color=”gray”]The ‘JavascriptWebExtensionsPackage’ did not load correctly.’ The problem may have been caused by a configuration change or by the installation of another extension.[/alert]
I had just installed SyncFusion’s Essential Studio which apparently screwed something up. I tried doing a repair on Visual Studio which unfortunately did not work.
I was able to fix it by following these steps:
- Close Visual Studio Open the *Users*\AppData\Local\Microsoft\VisualStudio\12.0\ folder
- Rename the ComponentModelCache folder
- Restart Visual Studio.
Visual Studio should now rebuild the cache and no longer display the error messages.
ASP.NET MVC Model Generator
In making the switch to ASP.NET MVC, I’ve moved away from using my old Data Access Layer that I’ve used for years and have opted to use Dapper as my ORM of choice in the quest for optimal performance. My DAL was actually pretty optimized for WinForms and WebForms (using straight SQL Queries and SQL parameters) but mapping it to models wasn’t something I had in mind when I created it. I’m finding Dapper takes some getting used too but it is still pretty fast. The downside is that writing the code for Models to wire it up is proving to be a little tedious.
To that effect, I wrote a little application that has helped me generate the models from a database dynamically. It’s in it’s infancy stages and something I cobbled together in less than 8 hours but it works. I’ll add more features too as time goes on if there’s enough interest or to satisfy my own needs. In the meantime, I’m open sourcing the project as it may help others and I’d love to see it become something grander if others are willing to contribute to it. There’s also some useful bits of code that others may find useful to reference like dynamically reading fields from a database, pluralization/singularization of words, amongst others.
You can find the repository on Github: https://github.com/gregvarghese/MVCModelGenerator
ESET AntiTheft Causes Dell Machines to Lose Permissions on C:
I just spent the past two days complaining about Windows 8 to everyone I know because of how awful the experience is. I installed Windows updates, rebooted, and the system stops working.
It turns out it wasn’t Windows causing the problem but ESET AntiTheft on Dell laptops. It turns out there’s a permission bug specific to Dell machines when ESET creates it’s ghost account and instead of giving it restricted access, the system essentially copies the permissions and then changes everything on the C: drive to a state where the permissions are no longer accessible.
Unfortunately, the only known fix at this point is to contact ESET support. I called their support line in North America and the tech knew about the issue right away. You’ll have to reboot into safe mode, and then get them to remote in to install a utility that runs a script that resets the permissions.
Contact Info here: http://www.eset.com/us/about/contact/
The tech assured me they are working with Dell to get this issue resolved so until they do, make sure you don’t activate ESET’s AntiTheft on the Dell machine.
Uninstalling Trend Micro Client/Server Security without a Password
Lost or forgot your Trend Micro Client/Server Password? How about inheriting a computer that had the software installed by an IT team or consultant that won’t give up the password? I had to work on a network with the latter and it’s rather annoying. The product is utter crap as the machine is spyware infested even though the antivirus is running and present. I went to uninstall it but can’t because the previous person/company password protected it and nobody has it.
Here’s how to bypass the protection:
- Load up Regedit and browse to:
HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc.\Allow Uninstall - Change the value to 1.
Now you can uninstall TrendMicro’s crappy product and replace with a real solution like Eset.
TrustedInstaller.EXE CPU Usage
Solution 1: Clear Problem History
The following fix is intended for situations where trustedinstaller.exe causes problems due to the Problem Reports and Solutions history maintained in Windows Vista.
- Go to Start and then select Control Panel.
- Turn on Classic View.
- Select Problem Reports and Solutions.
- Click Clear Solution and Problem History in the left panel.
- Confirm your decision.
- Exit the Problems Reports and Solutions Window and Control Panel.
You can also click Change in the Problems Reports and Solutions Window. And then change the configuration from Check for solutions automatically setting to Ask me to check if a problem occurs.
Solution 2: Change Microsoft Update Startup Settings to Manual
- Go to Start and then select Control Panel.
- Select Administrative Tools and then select Services.
- Scroll down to Microsoft Update, right-click on it and then select Stop.
- Right-click on Microsoft Update again and select Properties.
- On the General tab, set Startup type as Manual.
- Next, display the Recovery tab.
- Choose Take No Action and click OK for First Failure.
- Exit the properties dialog box.
- Bring up your Task Manager by pressing on Ctrl + Alt + Del or Ctrl + Shift + Esc.
- On the Processes tab, look for and select trustedinstaller.exe.
- Click End process to kill trustedinstaller.exe.
Solution 3: Disable Automatic Update
- Go to Start and then select Control Panel.
- Go to System and Maintenance.
- Click Turn automatic update on or off option.
- Next, depending on your preference choose one of the following options:
- Never check for updates (not recommended)
- Check for updates but let me choose whether to download and install them
- Download updates but let me choose whether to install them
- Click OK to save your changes and exit the dialog box.
Solution 4: Stop the Windows Module Installer That Runs Trustedinstaller.exe
- Click on Start, in the Start Search box, type msconfig and then press Enter.
- Click Continue when User Account Control prompt is displayed.
- In the System Configuration window that is displayed, open the Services tab.
- Locate and clear the Windows Module Installer check box.
- Click OK save your changes and exit the dialog box.
- Next, open Services window again and change the Startup type of Windows Module Installer to Manual.
Drobo Dashboard Can’t Connect to Drobo when ESET Firewall is Active
Have a Drobo storage unit? If you have ESET Smart Security Firewall enabled, you’ll probably find Drobo Dashboard can’t connect while the firewall is on even after adding all the required ports and services to ESET’s rules from the Drobo online help site (http://goo.gl/iVKVU).
After enabling the detailed logging in ESET, I found that ESET’s firewall was flagging Drobo Dashboard as an intrusion attempt and blocked it. From the Drobo help page (http://goo.gl/iVKVU):
Drobo Dashboard connects to port 5000 and then randomly picks a port in the range for broadcasting.
This is definitely not the most intelligent way to build a product when users who are trying to secure their home or business network and it’s no wonder that ESET flagged the behavior as suspicious. Luckily there’s a fix to keep ESET from blocking the Drobo connection:
- Make sure you add the rules as per Drobo’s site (http://goo.gl/iVKVU).
- Open the main program window by clicking ‘Start’ -> ‘All Programs’ -> ‘ESET’ -> ‘ESET Smart Security’.
- Click on ‘Setup’ on the left, and then click ‘Enter Advanced setup’ on the right to open the Advanced Setup tree.
- From the Advanced Setup tree on the left, Expand ‘Network’, and Click on ‘Personal Firewall’, and then select ‘Interactive mode’ from the Filtering mode drop-down menu on the right.
- From the advanced setup tree, click ‘Personal Firewall’ -> ‘Rules and zones’. Click the ‘Setup…’ button in the Trusted zone section and then choose ‘Allow sharing’. Click ‘OK’.
- Click ‘Personal Firewall’ -> ‘IDS and advanced options’. In the ‘Allowed services’ section, make sure all services are selected. Click ‘OK’.
Drobo Dashboard should now be able to connect to the unit with no issues.
Kill Multiple Processes at Once Via Command Line with Taskkill
Ever have a program or process that doesn’t end properly and runs in the background continuously?
I recently encountered this issue with VLC on one Windows 7 machine where it keeps the process never terminates. Since I never reboot the machine for other than Windows Updates, this amounted to 633 copies of VLC running in memory. Each process only used about 633k so it wasn’t an astronomical memory hog but multiply that by 633, you begin to feel the machine slowing down. Task Manager doesn’t let you kill multiple processes in bulk and I didn’t want to go through killing them one by one or rebooting.
The solution? Good old command line. Open up command prompt (start -> run -> cmd.exe). This snippet will kill all processes that start with the taskname:
TASKKILL /IM [TASKNAME]* /F
To kill all VLC processes, you’d use:
TASKKILL /IM vlc* /F
All running VLC processes will be terminated automatically.