Accessing KDE desktop via VNC
Submitted by ross on Sun, 07/05/2009 - 18:28I wanted to be able to connect to my Linux system's boot up screen remotely using VNC.
To do that, I needed to install x11vnc. Since I'm running Kubuntu, the KDE version of Ubuntu, I simply typed:
$ sudo apt-get install x11vnc
After poking around I found the xauth file in /var/run/xauth, so to start x11vnc, I typed
$ XAUTH=`ls -t /var/run/xauth/* | head -n 1` $ nohup x11vnc -display :0 -auth $XAUTH &
Since x11vnc complains there is no password, I could have instead used:
$ XAUTH=`ls -t /var/run/xauth/* | head -n 1` $ nohup x11vnc -passwd insert_password_here -display :0 -auth $XAUTH &
I tried:
$ XAUTH=`ls -t /var/run/xauth/* | head -n 1` $ x11vnc -usepw -display :0 -auth $XAUTH
and even
$ x11vnc -storepasswd insert_password_here $HOME/.vnc/passwd $ XAUTH=`ls -t /var/run/xauth/* | head -n 1` $ x11vnc -passwdfile $HOME/.vnc/passwd -display :0 -auth $XAUTH
but couldn't get either to work.
When I was done with this VNC instance, I removed it from memory via:
$ killall x11vnc
This doesn't kill the actual desktop, just the x11vnc instance in memory.
To create a new virtual KDE desktop, I installed vnc4server via:
$ sudo apt-get install vnc4server
and then created the desktop with:
$ vnc4server -geometry 1024x768 -depth 24 :1
For -geometry, I can effectively use any values I want, but I generally use smaller values, as a larger desktop takes longer to repaint.
For -depth I usually use 24, or 32.
When I was done with this desktop, I removed it from memory via:
$ vnc4server -kill :1
- ross's blog
- Login to post comments
nirsoft_installer 1.35 has been released (announcement)
Submitted by ross on Wed, 06/10/2009 - 08:35nirsoft_installer 1.35 has been released. Details at http://smithii.com/nirsoft_installer.
This seemingly duplicate entry has been created as some RSS readers, such as Google Reader, do not display updates to existing blog entries, even if the update date was changed. This entry will be deleted in a week or so. Therefore, please do not post comments to this entry. Post them to the above URL instead. Thanks!
- ross's blog
- Login to post comments
aria2 1.3.3 for Windows has been released (updated 12-May-09)
Submitted by ross on Tue, 05/12/2009 - 12:29aria2 is a download utility with resuming and segmented downloading.
Using the makefile aria2.mak, I successfully ported aria2 to Windows using the Debian MinGW cross-compiler. While aria2 compiles under native MinGW and Cygwin, the resultant executable was buggy using the supplied gcc version 3.4.5, and numerous unit tests fail.
After installing gcc 4.3.0 in MinGW using get_mingw.cmd and am now able to produce working binaries in my Windows environment. This leads me to believe that gcc 3.4.5 is not reliable under MinGW.
The latest MinGW binary, and source code is available at https://sourceforge.net/projects/aria2/files/.
Automatically Slipstream Windows XP with SP3 and All Post-SP3 Security Hotfixes with a Single Command (Updated 03-May-09)
Submitted by ross on Sun, 05/03/2009 - 08:25For information about slipstreaming Windows XP SP2, visit http://smithii.com/slipstream_xpsp2.
I've written the batch file xpsp3.cmd (updated 03-May-09) to automatically download and slipstream a standard Windows XP boot disk with Service Pack 2 and all post-SP3 security hotfixes.
It uses wget or curl (if either are found in the PATH), or your installed browser to download the updates. I have tested this with Internet Explorer, Firefox, and Opera. Other browsers should work, as well. The batch file xpsp3local.cmd (updated 03-May-09) will update the copy of Windows XP that is installed on the computer you run the command on. You may wish to do this, if you do not have, or want, the machine you want to hotfix connected to the internet, or if you are unable to run Windows Update for some reason (for example, if Internet Explorer isn't installed, or doesn't work properly, due to a virus or similar mishap). To slipstream the hotfixes, and burn the slipstreamed disk, I've created the makefile xpsp3.mak (updated 03-May-09). Details on usage below.Automatically Slipstream Windows XP with SP2 and All Post-SP2 Security Hotfixes with a Single Command (Updated 03-May-09)
Submitted by ross on Sun, 05/03/2009 - 08:25For information about slipstreaming Windows XP SP3, visit http://smithii.com/slipstream_xpsp3.
I've written the batch file xpsp2.cmd (updated 03-May-09) to automatically download and slipstream a standard Windows XP boot disk with Service Pack 2 and all post-SP2 security hotfixes. It uses wget or curl (if either are found in the PATH), or your installed browser to download the updates. I have tested this with Internet Explorer, Firefox, and Opera. Other browsers should work, as well. The batch file xpsp2local.cmd (updated 03-May-09) will update the copy of Windows XP that is installed on the computer you run the command on. You may wish to do this, if you do not have, or want, the machine you want to hotfix connected to the internet, or if you are unable to run Windows Update for some reason (for example, if Internet Explorer isn't installed, or doesn't work properly, due to a virus or similar mishap). To slipstream the hotfixes, and burn the slipstreamed disk, I've created the makefile xpsp2.mak (updated 03-May-09). Details on usage below.Automatically changing screen positions and default printer based upon my location
Submitted by ross on Sat, 02/28/2009 - 14:55Here's my startup.cmd script I wrote to automatically change thr screen positions, and the default printer, whenever I change locations. I place this in the directory C:\WINDOWS\system32\repl\import\scripts, so it will be executed automatically when I login. It uses res_set to change the screen locations and resolutions.
@echo off set scriptdir=%~dp0 pushd "%scriptdir%" >nul if not "%1" == "" (set location=%1) else (set location=) if not "%location%" == "" goto found ipconfig | findstr "Gateway" | findstr "10\.0\.0\.1" >nul if not errorlevel 1 set location=home ipconfig | findstr "Gateway" | findstr "192\.168\.1\.1" >nul if not errorlevel 1 set location=work ipconfig | findstr "Gateway" | findstr "192\.168\.3\.1" >nul if not errorlevel 1 set location=work2 if not "%location%" == "" goto found echo Cannot determine location. popd >nul exit /b 1 :found echo Configuring system for %location%... goto %location% :home res_set -m 0 -w 1920 -h 1200 -b 32 -x 0 -y 0 res_set -m 2 -w 1920 -h 1200 -b 32 -x 0 -y -1200 cscript /nologo /b "SetDefaultPrinter.vbs" "hp LaserJet 1320 PCL 6 (home)" goto eos :work res_set -m 0 -w 1920 -h 1200 -b 32 -x 0 -y 0 res_set -m 1 -w 1920 -h 1200 -b 32 -x -1920 -y -120 cscript /nologo /b "SetDefaultPrinter.vbs" "HP LaserJet 2100 PCL6 (work)" goto eos :work2 cscript /nologo /b "SetDefaultPrinter.vbs" "HP LaserJet 1020 (work2)" goto eos :eos popd >nul exit /b 0
Here's the SetDefaultPrinter.vbs script:
dim WshNetwork dim sout dim oFS const StdOut = 1 set oFS = CreateObject("Scripting.FileSystemObject") set sout = oFS.GetStandardStream(StdOut) sout.Write "Changing default printer to: " + Wscript.arguments.Item(0) set WshNetwork = WScript.CreateObject("WScript.Network") WshNetwork.SetDefaultPrinter Wscript.arguments.Item(0)
- ross's blog
- Login to post comments
si_installer 1.13 has been released (announcement)
Submitted by ross on Thu, 01/01/2009 - 10:59Details at http://smithii.com/si_installer.
This seemingly duplicate entry has been created as some RSS readers, such as Google Reader, do not display updates to existing blog entries, even if the update date was changed. This entry will be deleted in a week or so. Therefore, please do not post comments to this entry. Post them to the above URL instead. Thanks!
- ross's blog
- Login to post comments
nirsoft_installer 1.33 has been released (announcement)
Submitted by ross on Tue, 09/30/2008 - 09:42Details at http://smithii.com/nirsoft_installer.
This seemingly duplicate entry has been created as some RSS readers, such as Google Reader, do not display updates to existing blog entries, even if the update date was changed. This entry will be deleted in a week or so. Therefore, please do not post comments to this entry. Post them to the above URL instead. Thanks!
- ross's blog
- Login to post comments
Logging in as root in SecureCRT
Submitted by ross on Sun, 08/17/2008 - 12:04My sysadmin turned off root access, but gave me sudo rights to login as root.
To continue to login directly as root I copy pasted a connection profile, and then edited the property Connection / Logon Scripts / Logon script and pointed to the script sudo_root.vbs:
# $language = "VBScript" # $interface = "1.0" Sub Main crt.Screen.WaitForString "$" crt.Screen.Send "sudo su - root" & Chr(10) End Sub
- ross's blog
- Login to post comments
nirsoft_installer 1.32 has been released (announcement)
Submitted by ross on Sun, 08/10/2008 - 23:35Details at http://smithii.com/nirsoft_installer.
This seemingly duplicate entry has been created as some RSS readers, such as Google Reader, do not display updates to existing blog entries, even if the update date was changed. This entry will be deleted in a week or so. Therefore, please do not post comments to this entry. Post them to the above URL instead. Thanks!
- ross's blog
- Login to post comments
Dumping the GRANT statements in MySQL
Submitted by ross on Sun, 08/03/2008 - 14:42The following script will display your GRANT statements in MySQL in *nix:
$ mysql -e "SELECT CONCAT('SHOW GRANTS FOR ',QUOTE(user),'@',QUOTE(host),';') FROM mysql.user" --column-names=false -B | mysql --column-names=false -B 2>/dev/null | sed 's/$/;/'
Here's a sample output:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY PASSWORD '*FD1111DEADBEEFDEADBEEFDEADBEEFDEADBEEFDE' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*FD1111DEADBEEFDEADBEEFDEADBEEFDEADBEEFDE' WITH GRANT OPTION;
On Windows, replace /dev/null with NUL, and remove the sed command:
c:> mysql -e "SELECT CONCAT('SHOW GRANTS FOR ',QUOTE(user),'@',QUOTE(host),';') FROM mysql.user" --column-names=false -B | mysql --column-names=false -B 2>nul
You will then need to add the ; character manually.
You could even do this from inside the mysql client, in *nix:
$ mysql mysql> SELECT CONCAT('SHOW GRANTS FOR ',QUOTE(user),'@',QUOTE(host),';') FROM mysql.user INTO OUTFILE '/tmp/grants.sql'; mysql> source /tmp/grants.sql
and in Windows:
C:> mysql mysql> SELECT CONCAT('SHOW GRANTS FOR ',QUOTE(user),'@',QUOTE(host),';') FROM mysql.user INTO OUTFILE 'c:/grants.sql'; mysql> source c:/grants.sql
If you get an error message, try your %TEMP% directory:
C:> cd /d "%TEMP%" C:> dir /x .. Volume in drive C is volname Volume Serial Number is FEED-FACE Directory of C:\DOCUME~1\ross\LOCALS~1 01/23/2008 11:09 AM <DIR> Apps 08/07/2008 03:10 PM <DIR> Temp 0 File(s) 0 bytes 2 Dir(s) 6,727,245,824 bytes free c:> mysql mysql> SELECT CONCAT('SHOW GRANTS FOR ',QUOTE(user),'@',QUOTE(host),';')
- ross's blog
- Login to post comments
- Read more
Mediawiki's Openness Is Not a Good Thing Anymore
Submitted by ross on Sun, 07/20/2008 - 10:52Spammers found my MediaWiki based website, and flooded the site with over 1.2GB of link spam. To fix this, I locked down my site, so only sysops can change it, by adding the following to the end of my LocalSettings.php file:
// Implicit group for all visitors $wgGroupPermissions['*' ]['createaccount'] = true; $wgGroupPermissions['*' ]['read'] = true; $wgGroupPermissions['*' ]['edit'] = false; $wgGroupPermissions['*' ]['createpage'] = false; $wgGroupPermissions['*' ]['createtalk'] = false; // Implicit group for all logged-in accounts $wgGroupPermissions['user' ]['move'] = false; $wgGroupPermissions['user' ]['read'] = true; $wgGroupPermissions['user' ]['edit'] = false; $wgGroupPermissions['user' ]['createpage'] = false; $wgGroupPermissions['user' ]['createtalk'] = false; $wgGroupPermissions['user' ]['upload'] = false; $wgGroupPermissions['user' ]['reupload'] = false; $wgGroupPermissions['user' ]['reupload-shared'] = false; $wgGroupPermissions['user' ]['minoredit'] = false; // Implicit group for accounts that pass $wgAutoConfirmAge $wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true; // Implicit group for accounts with confirmed email addresses // This has little use when email address confirmation is off $wgGroupPermissions['emailconfirmed']['emailconfirmed'] = true; // Users with bot privilege can have their edits hidden // from various log pages by default $wgGroupPermissions['bot' ]['bot'] = true; $wgGroupPermissions['bot' ]['autoconfirmed'] = true; $wgGroupPermissions['bot' ]['nominornewtalk'] = true; // Most extra permission abilities go to this group $wgGroupPermissions['sysop' ]['move'] = true; $wgGroupPermissions['sysop' ]['edit'] = true; $wgGroupPermissions['sysop' ]['createpage'] = true;
- ross's blog
- Login to post comments
- Read more
nirsoft_installer 1.31 has been released (announcement)
Submitted by ross on Tue, 06/24/2008 - 10:10Details at http://smithii.com/nirsoft_installer.
This seemingly duplicate entry has been created as some RSS readers, such as Google Reader, do not display updates to existing blog entries, even if the update date was changed. This entry will be deleted in a week or so. Therefore, please do not post comments to this entry. Post them to the above URL instead. Thanks!
- ross's blog
- Login to post comments
php_installer 1.12 (for PHP 5.2.6) has been released (06-Jun-08)
Submitted by ross on Sat, 06/07/2008 - 14:47php_installer is an NSIS installer I whipped up to download and install PHP 5.2.6, PECL, the PHP CHM manual, and the Zend Optimizer found at http://www.php.net.
You can download the binary here and the binary with the source code here. Here's the changelog.txt:- ross's blog
- Login to post comments
- Read more
php4_installer 1.5 (for PHP 4.4.8) has been released (23-Jan-08)
Submitted by ross on Wed, 01/23/2008 - 21:25php4_installer is an NSIS installer I whipped up to download and install PHP 4.4.8, and the PHP CHM manual found at http://www.php.net.
You can download the binary here and the binary with the source code here.- ross's blog
- Login to post comments
- Read more
