25. December 2013 · Comments Off · Categories: Linux, Networking · Tags: ,

Problem – no WiFi after Fresh Install

tux_wifiAfter an upgrade from Mint 13 to Mint 16 using the “fresh upgrade” method again resulted in a system without wireless connectivity, this guide was created for future reference and possibly as an aid to others experiencing the same problem. The information here applies to the B43 driver, specifically for the 4311 PCI-ID/Chip ID, but the driver/firmware solution describe may be similar for other Broadcom PC-IDs also using the B43 driver (list below) and running on Debian/Ubuntu or derivative distros; however, keep in mind that derivative doesn’t imply compatibility in all cases. For further information about B43/B43 legacy wireless devices and driver/firmware solutions see http://wireless.kernel.org/en/users/Drivers/b43.

Similar PC-IDs for B43:
14e4:4307
14e4:4311
14e4:4312
14e4:4318
14e4:4319
14e4:4320
14e4:4357
14e4:5354

Note that in most cases PCI-ID correlates to the Chip ID, but that is not always the case, so identify your device using the PCI-ID.

Regardless of the PCI-ID, always check the distro’s documentation and user forums for the most up-to-date information. Broadcom wireless solutions constantly change and vary from distro to distro. 

System used for this Guide

The system used for this guide was an Intel Pentium T2310 / 1.46 GHz ( Dual-Core ) laptop with Mint 16 (Mate) freshly installed to the hard drive. The built-in wireless device was based on the BCM 4311 chipset. No other options existed for connecting to the Internet except for wireless, which didn’t work after the OS installation.

Broadcom Wireless Issues

In the past, wireless connectivity issues in Linux for devices using the popular Broadcom chipset were a common problem that frequently turned into a difficult, confusing, and time-consuming task. Considerable time and effort was often spent to perform multiple trial-and-error driver installations, command-line troubleshooting, reading and evaluating technical documentation, and following suggestions from other users in order to get wireless working. Although some Linux distros support Broadcom wireless out-of-the-box or provide options within the OS to install the correct drivers/firmware, most do not because of a variety of ongoing development, proprietary and support issues. For this reason, a Web search for Broadcom wireless connection problems often results in multiple pages of possible solutions and troubleshooting suggestions, much of which can be out-of-date and may no longer apply. The amount of information can overwhelm and confuse desperate users looking for an easy and quick solution. An informative Archlinux.org Wiki entry (2013), Broadcom Wireless, describes many of these issues and illustrates why so much confusion and seemingly conflicting information exists about getting wireless to work for Broadcom devices in Linux.

Current Support Issues

Fortunately, driver/firmware support and installation options for Broadcom wireless devices have steadily improved and increasingly don’t require as much user effort or technical expertise; however, this doesn’t mean that problems are now a thing of the past. Many users may still need to use another PC to hunt the Web for the correct drivers, may find themselves in the frustrating catch-22 position of needing a LAN connection in order to install the drivers, or learn that the correct drivers are not clearly specified, or when specified, are not included with the installation media.

For some Linux distros, driver/firmware installations may be an automated or a semi-automated process. Some distros feature automatic installation for B43 devices by detecting and installing the appropriate driver package during the OS install from the installation media, include them with the kernel image, or download them automatically using a LAN connection. Other distros, like Ubuntu/Debian and derivatives, may even provide customized installation files (like a deb file), where users need only to download and double-click the deb file to install the appropriate drivers/firmware (some deb files don’t include the drivers and may require a LAN connection to download them). Even when automatic or semi-automatic B43 wireless driver/firmware isn’t provided, users can still enable wireless using an extraction tool and open source or proprietary drivers to install the firmware – this is the process described in this guide.

Generally, three driver/firmware solutions exist for Linux users with Broadcom chip-sets:

1. brcmsmac/brcmfmac/brcm80211 – Open source kernel driver (newest, often included in latest kernel images)
2. B43/B43 legacy – Open source reversed engineered kernel driver (B43 only is covered in this guide)
3. broadcom-wl – Proprietary Broadcom STA driver

The necessary driver/firmware is dependent on the chipset/PCI-ID, type of wireless device, operating system, CPU architecture, and the OS version, although some Broadcom wireless devices are still unsupported in Linux. Regardless of the chipset/PCI-ID, the distro’s documentation and user forums should always be checked for the latest information since driver solutions and installation options vary from distro to distro and even between versions within a distro.

Identifying the Wireless Device

To identify a Broadcom wireless device in Linux, type the following command (case-sensitive) into a terminal:

lspci -vnn -d 14e4:

lspci terminal
The above is the output of the lspci command. The PCI-ID is identified within the brackets on the 2nd line by 14e4:4311, where 14e4 is the identification code for Broadcom, and 4311 is the device. In this case, 4311 also identifies the Chip ID. The <access denied> after Capabilities is displayed because the lspci command was executed without using administrator privileges (sudo or su).

Additional wireless identification and troubleshooting commands can be found at the Ubuntu Community Help Wiki.

Tested Solution – Install firmware from driver source file

The verified solution for this guide was to use another PC to download the necessary files onto a USB flash drive and then transfer those files to the user directory of the Linux Mint 16 PC with no Internet connection. The files were fwcutter as a deb file and the Broadcom-wl proprietary driver source file. Fwcutter is a tool written for BCM43xx driver files to extract firmware from driver source files.

Steps:

1. Download b43-fwcutter for your architecture (bottom of page) from http://packages.debian.org/squeeze/b43-fwcutter. In this case, b43-fwcutter_013-2_amd64.deb was used, but an older version or a 32 bit version probably would have worked as well.

2. Download the source file from http://mirror2.openwrt.org/sources/. In this case, broadcom-wl-4.150.10.5.tar.bz2 was used.

3. Transfer the files to your user directory on the Linux PC and double-click the b43-fwcutter file to install it. Ignore any warnings about the version being out-of-date.

4. Run the following commands to extract and write the firmware to /lib/firmware. Ignore any warnings.

tar xfvj broadcom-wl-4.150.10.5.tar.bz2
sudo b43-fwcutter -w /lib/firmware broadcom-wl-4.150.10.5/driver/wl_apsta_mimo.o

5. Reboot the PC.

6. The wireless should now work. If so, look for and install any updated B43 wireless firmware/fwcutter/drivers using the Synaptic Package Manager. Do not use B43 legacy.

Other Possible Solutions

Ubuntu community wiki. Solutions for a number of PCI-IDs (not tested):
http://help.ubuntu.com/community/BroadcomSTA%28Wireless%29

Deb files. Automatically installs driver/firmware for deb-compatible distros from pkgs.org. Double-click to install (not tested):
http://pkgs.org/download/firmware-b43-installer

References:

B43 wireless information page:
http://wireless.kernel.org/en/users/Drivers/b43

B43 Driver download:
http://mirror2.openwrt.org/sources/

Linux Mint solution:
http://forums.linuxmint.com/viewtopic.php?f=53&t=127202

Ubuntu Community Help Wiki:
http://help.ubuntu.com/community/WifiDocs/WirelessTroubleShootingGuide/Drivers
http://help.ubuntu.com/community/WifiDocs/WirelessTroubleShootingGuide/Commands#lshw

 

Share
Recreating directory structures can be a tedious and error-prone chore, especially if using the right-click method to create multiple structures and folders. This guide describes three methods to easily copy directory structures (without files) in Windows: with the command line, with GUI tools dedicated for that purpose, and by configuring a freeware file manager, FreeCommander, to enable this function.

http://clker.com

Copying Directory Structures from the Command-line

For those comfortable with the command-line, two commands that can be used for this purpose are the Xcopy and Robocopy, both of which have tons of options. Although others, such as the FOR command could also be used, Xcopy and Robocopy are by far the most popular tools used for this purpose.

Xcopy

Xcopy is included in systems up to Vista. It’s a more powerful version of copy with additional features that can be used to copy files, directories, and whole drives. Note that although Xcopy is included with Vista, it has been deprecated in favor of RoboCopy.

To use Xcopy to clone a directory without files, use the following syntax:

xcopy /t /e "C:\Your Folder" "C:\New Folder"

/t = Copies the subdirectory structure, but not the files

/e = Copies subdirectories, including empty ones

Note: When using Xcopy with the above switches, you will be asked to specify if the target is a directory or a file before the Xcopy command executes; however, if the command is executed from a batch file, no user interaction is required.

Additional Xcopy commands can be found here.

Robocopy

Robocopy stands for “Robust file copy.” It’s a standard feature for Windows starting with Vista. It’s can also be installed in WinXP as part of the Windows Resource Kit.

To use Robocopy to clone a directory without files, use the following syntax:

robocopy "C:\Your Folder" "C:\New Folder" /e /xf *

same as above but without displaying status:

robocopy "C:\Your Folder" "C:\New Folder" /e /xf * >null

same as above and create a log:

robocopy "C:\Your Folder" "C:\New Folder" /e /xf * /log:yourlogfile.txt

/e = Copies subdirectories, including empty ones.

/xf = Excludes files matching the specified names or paths. Wildcards “*” and “?” are accepted

Additional Robocopy commands can be found here.

Freeware GUI Tools for copying Directory Structures

Two easy-to-use GUI (graphical user interface) apps dedicated specifically to creating directory structures without files are TreeCopy and Miroirs:

TreeCopy – Portable and freeware. Runs on Win95 to Win7.

treecopy screenshot

Miroirs - Freeware. Requires installation. Runs on XP/Vista/Win7

Miroirs screenshot

FreeCommander setup to copy Directory Structures

FreeCommander is a freeware file manager that can be configured to copy directory structures using a customized batch file with the Xcopy and/or Robocopy commands. FreeCommander Ver. 2009.02b was used for this example. These instructions are modified from those provided on the FreeCommander forums.

FreeCommander Instructions

Create a batch file with the following code and save it with any name desired such as “copyFolderStructure_freecommander.bat.” For Xcopy the batch file’s main code consists of:

xcopy %1 %2 /t /e

REM

%1 and %2 are the first and second parameters passed to the batch file (structure to copy and target)
The /t and /e options are the same as above

For Robocopy the batch file’s main code consists of:

robocopy %1 %2 /e /xf *

REM

%1 and %2 are the first and second parameters passed to the batch file (structure to copy and target)
the /e and /xf * options are the same as above

Note: a pause can be entered at the end of either of the batch files above to keep the command window open for viewing the output

Example batch files for FreeCommander:
copyFolderStructure_freecommander_xcopybat.txt
copyFolderStructure_freecommander_robocopybat.txt

From the menu, select Extras->Favorite Tools->Edit or use (SHIFT+CONTROL+Y). Click image below to enlarge.

freecommander menu

Select none from the left-hand column named Categories, then click once in the Items column.

FreeCommander Tools Configuration

Use the Items:Add to list button that appears above the Items column to create an item, for instance Copy Folder Structure.

Select Seek program by clicking the blue arrow next to the program field to navigate to and select the saved batch file’s (e.g. C:\tools\copyFolderStructure_freecommander_robocopy.bat) full path into the program field.

Enter the following into the parameter field:

"%LeftDir%" "%RightDir%" %Dlg%

The variables, %LeftDir% and %RightDir%, pass the address of the left and right folders to batch file parameters %1 and %2. The %Dlg% variable is optional and may be omitted if desired. It is used to display a Run program window (screenshot below) before actually starting the script to allow the folder names to be verified. It also provides a way for the operation to be cancelled.

dialog

If desired, add an icon by using the blue button next to the icon field to navigate to the icon’s location.

Make sure the boxes are checked as in the Define Favorite Tools screenshot above before hitting OK.

Tool Selection
The toolbar now contains an entry for copying Folder Structures. The tool can be selected from the menu with Extras->Favorite Tools->Name of your tool or by using the favorites icon (make sure Extras is enabled in Extras->Settings->View->Toolbar if it’s not visible on the toolbar).

Using FreeCommander

To use, select the structure to copy in FreeCommander’s left pane and select the target directory in the right pane. Select and click your tool from the toolbar or menu as described above. After the Run program dialog appears, click OK to continue.

FreeCommander Select

Xcopy doesn’t provide an option to display progress or completed operations. However, with Robocopy, the output will display the copy operation details as shown below (a pause was used in this batch file):

RoboCopy Output
If no errors occur, the folder structure will be copied as in the following screenshot:

FreeCommander copied

Share
01. January 2013 · Comments Off · Categories: Linux · Tags:
Since version 1.98, GRUB 2 began replacing GRUB version 0.9x, which is now known as GRUB legacy. GRUB 2 represents a major revision over its predecessor to make it more portable and modular. And although GRUB legacy is no longer being developed, bug fixes for it continue, and it’s still used as the default boot loader for a number of Linux distros. Over time, GRUB 2 usage has steadily increased and while still a work in progress, it’s probably the most common boot loader for Linux distros. Although GRUB 2 is officially known as GRUB, Linux distro repositories may include GRUB 2, GRUB legacy, or both versions. Repositories that include both versions may make the distinction between them as GRUB 2 and GRUB, GRUB and GRUB legacy, or GRUB 2 and GRUB legacy. The naming inconsistency between distros can be somewhat confusing, but this is to be expected during any transition.

What is covered in this guide

This is not a comprehensive guide on GRUB 2; rather, this is a quick reference covering frequently used GRUB 2 tweaks and option edits for most Linux distros; particularly those based on Debian/Ubuntu or Slackware. For detailed information about GRUB 2, see the references at the end of this guide.

This guide assumes that the reader already has GRUB2 installed for a single boot or a multiboot Linux system. Note that all changes to GRUB 2 options must be done while logged in as root or by use of sudo. All commands and options described should be verified for correctness using the documentation for your particular Linux distribution.

GRUB 2 summary

Recent converts to GRUB 2 probably have noticed that the Boot menu basically looks the same as GRUB legacy. Although they appear similar, the way GRUB 2 generates its menu is very different. Also, GRUB 2 now places its files in three locations:

  • /boot/grub/grub.cfg  (GRUB 2 main configuration file, replaces menu.lst, a product of the script files in /etc/grub.d/)
  • /etc/grub.d/  (directory containing several GRUB 2 script files)
  • /etc/default/grub  (GRUB 2 customization file)

Most GRUB 2 files are updated/regenerated automatically during package updates, when new kernels are added, after installing additional OS’s on multi-boot systems, or whenever GRUB is manually updated after making changes to the GRUB options as described in this guide. Generally, editing these files is not recommended, not only because it can cause boot problems, but also because most of the files will be overwritten anyway during system updates. The single file that users can generally edit without issue is /etc/default/grub, which holds most of the settings that will be of interest to users reading this. This file contains customization settings such as the default menu entry, timeout, default boot, graphics, and more. An example GRUB file from Lubuntu 12.10 (original settings slightly modified) is shown below:

# If you change this file, run '<strong>update-grub</strong>' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

<span style="color: #000000;">GRUB_DEFAULT=0</span>
<span style="color: #000000;">#GRUB_HIDDEN_TIMEOUT=0</span>
GRUB_HIDDEN_TIMEOUT_QUIET=true
<span style="color: #000000;">GRUB_TIMEOUT=-1</span>
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
<span style="color: #000000;">GRUB_CMDLINE_LINUX_DEFAULT=""</span>
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
<span style="color: #000000;">GRUB_GFXMODE=auto</span>

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Quick Edits for /etc/default/grub

Note: A grub file can contain many more options than those shown in the above file. For a full list of options refer to the GNU Grub Manual (link in reference section below). Note that all GRUB 2 commands or changes to its files must be done while logged in as root or by using sudo.

As previously mentioned, the above sample GRUB 2 file is essentially the same as the default file for Lubuntu ver. 12.10. Note that the option entries listed in the above file may differ for other Linux distributions and/or versions. In most cases, users will want to make minor changes to the option entries that are common to all distributions and/or versions, such as timeout, default boot OS, displayed boot information (quiet splash), or the display resolution. To enable a listed option, remove the comment (#) in front of the option entry and change its value as appropriate. If a desired option is unlisted, it may be added to the end of the file. Also notice that the above file contains comments that provide information for enabling/disabling many of the listed options. After making any change to this file, it must be saved and GRUB updated in order for the changes to take effect on the next boot (see saving and updating section below). A few common option entries are described as follows:

GRUB_DEFAULT=0
Default option setting is 0.
This is the default menu entry to be booted. Zero (0) is the first boot option listed in /boot/grub/grub.cfg.

GRUB_TIMEOUT=-1
Default option setting is 5.
Sets the time in seconds that the boot menu displays before it automatically boots the default boot entry. If a key is pressed before that time, the timeout is cancelled, allowing manual selection of the entry with no time limit. The value “-1″ causes the menu to be displayed indefinitely.

GRUB_CMDLINE_LINUX_DEFAULT=”"
Default setting is distro dependent.
Passes arguments to the end of the boot command line for the kernel of the menu’s default entry. Added in addition to any arguments specified in GRUB_CMDLINE_LINUX below. This option is often set to “quiet splash” to suppress boot information and display the splash screen. Note that “quiet” and “splash” are separate values. Remove “quiet splash” between the parentheses to display all boot information without a splash screen.

GRUB_CMDLINE_LINUX=”"
Default setting as above.
Passes arguments to the end of the boot command line for the kernels of all the menu entries.

GRUB_GFXMODE=auto
Default setting is “auto”.
Sets the graphical terminal resolution. Only modes supported by the graphics card VESA BIOS Extensions (VBE) can be used. To determine the available screen resolutions, type “c” for a command line at the GRUB 2 boot menu and then enter “vbeinfo.” The syntax for the option value is widthxheight[xdepth]. Some common option values are 1400x900x32, 1024×768, and 800×600.

#GRUB_DISABLE_RECOVERY=true
Recovery mode entries are generated by default.
Enable by removing #, which will disable generation of the recovery mode entries; otherwise, for each Linux kernel, at least two menu entries will be generated – the default entry and a recovery mode entry.

Saving and updating the edited /etc/default/grub file

After editing and saving the /etc/default/grub file the following command must be executed for the changes to take effect:

sudo update-grub

To restore the default settings for GRUB 2, reinstall GRUB 2 by executing the following command:

sudo grub-install /<target>

Where <target> /dev/sda, /dev/hda

GRUB 2 tools

Graphical tools for configuring Grub 2 have become more common as Grub 2 matures. One GUI tool now available on many repositories is grub-customizer. See this How-to-Geek article for a description of this tool.

Changing the GRUB 2 background image

A good tutorial describing how to change the GRUB 2 background image:

The Geek Stuff – How to Change GRUB Splash Image, Background, Font Color on Your Linux

 

References:

GNU GRUB Manual 2.00~rc1

openSUSE® – Chapter 10. The Boot Loader GRUB2

GRUB 2 bootloader – Full tutorial by Dedoimedo

Official Ubuntu Community Documentation – Grub 2

Grub 2 Basics by DRS305 – Ubuntu Forums

 

Share
21. November 2012 · Comments Off · Categories: TechBits · Tags: ,
Placesbar Editor is a freeware tool that provides a convenient way to change any of the five folders on the Places Bar menu to whatever you want without directly editing the registry. PlacesBar Editor works in Windows 2000/ME/XP/Vista and Office. For Vista and above, the ability to change the Places Bar is built into the operating system, but apparently not for the Basic and Home Editions of Vista or Win7. For Vista or Win7 versions other than the Basic or Home editions, see WinVistaClub’s article: How To Add Your Own Folders To The Places Bar Or Favorite Links. In any case, for XP and older systems, this is a must-have utility. For further information, see the review on PlacesBar Editor at Freeware Genius.

places bar

 

Share
28. October 2012 · 1 comment · Categories: Development · Tags:
This guide describes how to setup a text editor to use the Visual C++ Studio Express compiler. Although many IDEs, including Visual C++ Studio, can edit code, text editors (a.k.a. programming or code editors) are often simpler, faster, are easier to use and configure, and have a shorter learning curve, especially since many users already use them and are thus familiar with the interface. In addition, many older and slower computers don’t have the resources to run IDEs such as Visual Studio very efficiently.

Many of the popular free compilers once used with text editors are now considered outdated. Today, the trend is towards using dedicated IDEs to write and compile code in an integrated environment such as Visual C++ Studio, or with other IDEs designed to be compatible with one or more independently developed compilers. Because IDEs have largely replaced the now out-of-fashion text editor as the standard coding environment, many text editors are no longer developed, supported or updated specifically for use with compilers. Because of these factors, many text editors may no longer work easily with up-to-date compilers. This guide provides one workaround solution.

The instructions for this guide were tested on a PC running Windows XP SP3, Visual C++ Studio Express 2010, and using the PSPad (ver 4.5.3) text editor. The instructions should be similar for other versions of Windows, Visual C++ Studio editions, and other text editors.

Visual Studio’s compiler is the cl.exe executable located in the “C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\” directory. Without getting into all the technical details, this file only executes properly within Visual Studio’s integrated environment, so directly setting it up in PSPad’s highlighter settings won’t work. In fact, even if you try to execute cl.exe from a Windows Command window within Visual Studio, you will get an error. The solution is to compile from Visual Studio’s command window, which looks just like a regular Windows Command window, but is actually the Visual Studio environment. To accomplish this, the source code file from the text editor is passed to a batch file, which starts Visual Studio’s environment and compiles the file. Sounds somewhat complicated, but it’s simple once explained.

Below is the batch file code:

@echo off

REM This file allows text editors to compile C++ files in Visual C++.

REM Modified from the shortcut in Program Files
CALL "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"

REM For 32bit Intel Processors
rem CALL "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"

cl.exe /EHsc %1

pause

Basically, the batch file consists of only four lines: (1) @echo off, (2) CALL the Visual Studio environment, (3) pass the source file to cl.exe with parameters, and (4) pause. That’s it. Copy the code and save it with a .bat file extension. I saved my file as vsbat.bat. There are two CALL commands in the batch file to two batch files in VS (Visual Studio). The first (vcvarsall.bat) is the path taken from the shortcut for the VS Command window in the start menu and slightly modified for use in the batch file above. The other (vcvars32.bat), is the path for the VS environment batch file for 32bit processors in the “VC\bin\” directory. If you have another processor, or use another edition of VS, either batch file may have a slightly different path, name and/or contents depending on your processor. If any of the paths are different from those above, just right click on the VS Command prompt icon in the start menu and and select properties to get the path and change the above batch file accordingly. In any case, both CALL statements just start the VS environment in a Command window according to the processor type. In the above batch file, the 32bit Intel Processor command is commented out but left in for information purposes. The first one should be the only one necessary. The cl.exe command starts the compiler with the “/EHsc” option which tells the compiler not to throw a C++ exception and “%1″, which is the source file parameter passed to the batch file. Finally, pause just keeps the command window from closing.

Save the above batch file somewhere on your PC and start PSPad. Select Settings->Highlighter Settings->C/C++->Compiler Tab in PSPad’s menu. Enter the information as shown in the screenshot below (click to enlarge image):

PSPad compiler settings

For the Compiler setting, enter the path to the batch file you saved (vsbat.bat). For the Parameters setting, enter “%File%” (with parentheses), which is the source file currently loaded in the editor. The Default Directory entry is optional and self-explanatory. For the Run after Compilation setting enter “cmd.exe /K %Name%.exe” to automatically run the executable after compilation (after closing the VS Command Window). Check the Save All Files Before Compilation box and hit OK to save the settings. That’s it. PSPad is ready to compile C++ source files with Visual Studio and to run its executables.

Share
10. April 2012 · 6 comments · Categories: TechBits · Tags:
unknown exception dialogAn unknown Exception may occur when launching Notepad++ ver. 5.9 (Unicode) or later. This problem appeared on a PC running WinXP SP3 32-bit, and according to information on Sourceforge, the issue may also apply to Vista, but not Win7. The cause appears to be four plugins that may be incompatible with the updated version of Scitilla.

The four plugins are:

  • AHKExternalLexer.dll
  • ExternalLexerKVS.dll
  • NppExternalLexers.dll
  • Oberon2LexerU.dll

Update (03/21/13): Many users experiencing the unknown exception issue with Notepad++ versions since 5.9 have resolved the problem by uninstalling the PreviewHTML.dll plugin instead (see comments).

Users can move the plugins one at a time into another folder within the “plugins” folder and relaunching the program to identify the plugin(s) responsible. In the case of the WinXP machine noted above with this problem, it was necessary to move only a single plugin, the NppExternalLexers.dll file, into another folder (e.g., disabled_plugins) to get Notepad++ to launch without error. The responsible plugin(s) can also be deleted or renamed.

Share
26. February 2012 · Comments Off · Categories: TechBits · Tags:
error symbol

After clicking organize favorites in the Internet Explorer® favorites menu, a dialog may appear with the following error: 

An error has occured in this dialog.
Error: 100
Invalid class string

 
This issue may be caused by a missing MicroSoft® javasript registration. If so, it’s easily fixed in WinXP, Vista or Win7 by registering the regsvr32 jscript.dll. Visit the below link for detailed instructions:

The Winhelp Online Help Blog – Fix for Error 100 Invalid Class String in Internet Explorer When Opening Organize Favorites

 

Share

This guide describes the use of the WinRAR command-line tools for compressing and uncompressing files in a directory and their use in batch files. This guide is an extension of a previous post, Automate Zipping Tasks using the Command-line Interface that covered the use of the command-line tools for two free compression utilities, IZArc and 7-Zip. The information was tested on a Windows PC running Vista.

compress

WinRAR is a popular and powerful archive manager that can be used from the command-line or with scripting languages such as batch files. It includes two command-line tools, rar.exe and unrar.exe, where rar.exe compresses and unrar.exe uncompresses files. Both are located in the “C:\Program Files\WinRAR” folder in the installable version. Although WinRAR is shareware, it can be used on a trial basis for 40 days. Using WinRAR’s command-line tools is similar to those for IZArc and 7-Zip. The syntax for using the WinRAR executables is:

WinRAR <command> -<switch1> -<switchN> <archive> <files...> <@listfiles...> <path_to_extract\>

Examples to compress a folder:

rar a -r yourfiles.rar *.txt c:\yourfolder

creates archive yourfiles.rar and compresses all .txt files in c:\yourfolder and all its subfolders

rar a yourfiles 

creates archive yourfiles.rar and compresses all files in the current folder, but doesn’t include subfolders (note lack of extension; WinRAR will use the default extension .rar)

“a” command adds to the archive

“-r”  switch recurses subfolders

Examples to uncompress a folder: 

unrar x c:\yourfile.rar *.gif c:\extractfolder\

extracts all *.gif files from yourfile.rar to c:\extractfolder\ (trailing backslash required) and restores the folder structure

unrar e c:\yourfile.rar 

extracts all files in c:\yourfile.rar to the current folder (folder structure ignored)

“x” command extracts with full paths

“e” command extracts and ignores paths

Example using Multiple Switches:

rar a -r -u -df -x*.bat earchive.rar c:\test\*.*

compresses all new or updated files from c:\test and its subfolders to earchive.rar, deletes the files after they are added to the archive, and excludes any files with a “bat” extension,

“a” command adds to the archive

“-r”  switch recurses subfolders

“-u” switch. Equivalent to the “u” command when combined with the “a” command. Adds new files and updates older versions of the files already in the archive

“-df” switch deletes files after they are moved to the archive

“-x” switch excludes the specified file(s) from the operation

Basic rules for WinRAR:

  • When files or listfiles are not specified, all files in the current folder are processed
  • When specifying all files in a folder, yourfolder or yourfolder\*.* are equivalent
  • Folder structures are automatically saved in archives (but not automatically extracted)
  • WinRAR uses the .rar extension by default, but that can be overridden by specifying the zip extension in the archive name
  • Switches and commands are not case sensitive and can be written in either upper or lower case

Another point is that WinRAR doesn’t appear to use the Windows path environment variable, so it must be specified either at a command prompt, set permanently in the environment variable settings, or specified in a batch file.

To set the Windows path environment variable temporarily at a command prompt or in a batch file, use the following command:

set path="C:\Program Files\WinRAR\";%path%

To set it permanently in the Windows path for your PC:

start–>Control Panel–>System–>Advanced system settings–>Advanced Tab–>Environment Variables–>System Variables–>Path–>Edit. Add the path ;C:\Program Files\WinRAR; to the end (don’t forget the single semicolons at the beginning and end). Hit OK three times.

Using WinRAR in Batch Files:

Two batch file examples are provided, The first (compress_rar_rev1.bat) provides several compression options such as such as compressing all files in a folder or a folder and its subfolders, with options to compress them into a single archive or individually and to include or exclude paths. The second batch file (uncompress_rar.bat) decompresses all .rar files from a folder and places the extracted files into another directory. Be sure to change the extension(s) to .bat before using either file. Both of the following batch files temporarily set the Windows path environment variable for the WinRAR folder when executed.

compress_rar_rev1.bat

uncompress_rar.bat

 

Share
08. December 2011 · Comments Off · Categories: Networking, Web · Tags: , ,
Two ways to use SSH to secure Internet connections are local port forwarding and dynamic port forwarding. Local port forwarding forwards web traffic from a server, while dynamic port forwarding transforms your SSH client into a SOCKS proxy server. Both can be useful for secure Internet access in insecure environments such as public networks. To use either, you need to be able to login onto a remote system. Both are easy to use.

Local Port Forwarding

Local port forwarding can be used to access specific sites from another machine. For example, to route traffic from www.somewebsite.com on a remote PC (user@yourdomain.com) to port 12345 on a client PC, the following could be entered into a command window:

ssh -L 12345:www.somewebsite1.com:80 user@yourdomain.com<host>

multiple connections may also be combined into one command as follows:

ssh -L 12345:www.somewebsite1.com:80 -L 23456:www.somewebsite2.com:80 user@yourdomain.com<host>

Use:
You just need to open a browser and point it to http://localhost:12345/ to securely access somewebsite1.com or http://localhost:23456/ to access somewebsite2.com.

Note: An IP address can also be used in place of yourdomain.com (e.g. user@192.168.1.1).

Dynamic Port Forwarding

Dynamic port forwarding is even more powerful as it allows you to securely connect to any web page and to bypass firewalls. To set it up, the following could be entered into a command window:

ssh -C -D 23456 user@yourdomain.com
  • The -C is optional and is used to enable compression, which can speed up connections
  • The -D enables dynamic port forwarding
  • 23456 is the port on the client PC

Use:
To use this connection, you will need to configure your browser to use a SOCKS proxy. See the following articles on how to do this for your browser:

Make Tech Easier – How to Secure Your Internet Connection via SSH

Ubuntu Help - SSHOpenSSHPortForwarding (see Dynamic Port Forwarding)

The How-to-Geek – 5 Cool Things You Can Do With an SSH Server (see SSH Tunneling)


Useful Related Articles:

Linux Magazine – Port Forwarding with SSH

OpenBSD Man Pages for SSH - Manual Pages

Red Hat Magazine – SSH Port Forwarding

University of Victoria – An Introduction to the Black Art of Port Forwarding with SSH

Share
22. October 2011 · 6 comments · Categories: Windows · Tags:
Hard Links, Junction Points and Symbolic Links are linking mechanisms used to refer to other files, directories, or volumes. Generally, a Hard Link is a file that acts like a representation of another file on the same drive without actually duplicating that file. A Junction Point (or directory hard link) is a type of hard link that acts like a representation of a directory, a partition or another volume. A Symbolic Link (or soft link) is a file similar to a shortcut in that it points to a filename or directory name, but it’s handled at the system level rather than at the application level. Often confused with shortcuts as well as with each other, Hard links, Symbolic links and Junction Points are not the same; although like shortcuts, deleting either links or junction points usually won’t delete the target and vice versa (see exceptions below). Of the three, Symbolic Links are more similar to shortcuts than either Hard links or Junction Points, and they are generally more flexible, easier to use, and safer. When given a choice, most professionals recommend using Symbolic Links.

Although Symbolic Linking has been around since 1978 and shortly thereafter standardized in UNIX and UNIX-like Operating Systems, it’s been present in Windows only since Vista. Symbolic Linking was introduced in Vista to replace Hard Links and Junction Points and to enhance compatibility with UNIX and UNIX-like systems. Hard Linking for files and support for directory hard links (Junction Points) have been present in Windows since Win2K – often using different implementations in each succeeding Windows version. Because the development of linking in Windows has been relatively recent and ongoing, a number of different linking methods have been included, supported, or made available as third-party add-ons depending on the Windows version. Currently, Hard Links, Junction Points and Symbolic Links in Windows are only supported for the NTFS file system. Note that Windows does not support Hard Links or Junction Points to directories on remote shares; however, Symbolic Links can point to remote files and directories on SMB network paths.

Hard Links, Junction Points, Symbolic Links, and Shortcuts are further contrasted below:

Hard Link (Linking for individual files):

  • A file that acts like a representation of a target file on the same drive
  • Has the same size as the target without duplicating it (doesn’t use any space)
  • Interpreted at the operating system level (SW apps can act upon the target through the link)
  • Deleting the Hard Link does not remove the target file
  • If the target is deleted, its content is still available through the hard link
  • Changing the contents through the Hard Link changes the target contents*
  • Must reside on the same partition as the target file
  • Compatible with Win2k and above in Windows

* Some text editors save changed text to a new file and delete the original file, which can break the link. This behavior can be changed in some editors by forcing a save over the original file instead. See discussion at Jameser’s Tech Tips here for more information.

Junction Point (Directory Hard Link):

  • A file that acts like a representation of a target directory, partition or volume on the same system
  • Has the same size as the target without duplicating it (doesn’t use any space)
  • Interpreted at the operating system level – transparent to SW programs and users
  • Deleting the Junction Point does not remove the target*
  • If the target is moved, renamed or deleted, the Junction Point still exists, but points to a non-existing directory
  • Changing the contents through the Junction Point changes the target contents
  • Can reside on partitions or volumes separate from the target on the same system
  • Compatible with Win2k and above in Windows

*A Junction Point should never be removed in Win2k, Win2003 and WinXP with Explorer, the del or del /s commands, or with any utility that recursively walks directories since these will delete the target directory and all its subdirectories. Instead, use the rmdir command, the linkd utility, or fsutil (if using WinXP or above) or a third party tool to remove the junction point without affecting the target. In Vista/Win7, it’s safe to delete Junction Points with Explorer or with the rmdir and del commands.

Symbolic Link (Soft Link):

  • A file containing text interpreted by the operating system as a path to a file or directory
  • Has a file size of zero
  • Interpreted at the operating system level – transparent to SW programs and users
  • Deleting the Symbolic Link does not remove the target
  • If the target is moved, renamed or deleted, the link still exists, but points to a non-existing file or directory
  • Points to, rather than represents, the target using relative paths
  • Can reside on partitions or volumes separate from the target or on remote SMB network paths
  • Compatible with UNIX and UNIX-like systems and with Vista and above in Windows

Shortcut:

  • A file interpreted by the Windows shell or other apps that understand them as paths to a file or directory
  • File size corresponds to the binary information it contains
  • Treated as ordinary files by the operating system and by SW programs that don’t understand them
  • Deleting the shortcut does not remove the target
  • Maintains references to target even if the target is moved or renamed, but is useless if the target is deleted
  • Points to, rather than represents, the target
  • Can reside on partitions or volumes separate from the target on the same System
  • Compatible with all Windows versions

Windows Applications for Creating Links:

A number of applications are available for creating links in Windows including those bundled with the operating system and third-party tools. Some of the more well known are summarized below.

Utilities included with Windows:

  • fsutil – a command line tool included with WinXP and above. It can only create Hard Links for files - it doesn’t create directory hard links (Junction Points) or Symbolic Links. Further information about this tool is available at Commandwindows.com.

usage: FSUTIL hardlink create new_filename existing_filename

  • mklink – a command line tool included with Vista and Server 2008 and above. The most current link creation tool included with Windows. It creates Hard Links, Symbolic Links and Junction Points.

usage: mklink [[/d] | [/h] | [/j]] <NameofLink> <Target>

/d – Creates a Symbolic Link for a directory. If no flag used, creates a Symbolic Link for a file (default)

/h – Creates a Hard Link

/j – Creates a Junction Point

<NameofLink> – The name for the Symbolic Link being created

<Target> – The relative or absolute path of the target

/? – Help

Third-party Tools:

Command line tools:

  • junction.exe – by Sysinternals  - Creates Junction Points and includes additional commands for displaying and deleting them. Runs on Windows XP and higher and Windows Server 2003 and higher.

display reparse point* info usage: junction.exe [-s] [-q] <file or directory>

-q – Don’t print error messages (quiet)

-s – Recurse subdirectories

create usage: junction.exe <junction directory> <junction target>

delete usage: junction.exe -d <junction directory>

*Reparse points are redirections in the Windows file system using user-defined data in tags to identify and process files.

  • linkd.exe – Part of the Windows 2003 Resource Kit  - Creates and deletes Junction Points. (For Win2k, WinXP and Windows Server 2003)

create usage: linkd newdirname existingdirname

delete usage: linkd newdirname /D

Context Menu/Shell tools:

  • NTFS Linkelsdoerfer.name – Creates Hard Links and Junction Points using drag and drop with the right mouse button. Works with Win2K (NTFS ver 5 or greater) and above.

GUI-based tools:

  • Junction Link MagicRekenwonder Software – GUI-based application to create, list, and remove Junction Points. Also lists Symbolic Links and Mount Points. Works with Win2K, XP, 2003, Vista, Windows Server 2008 and Windows 7.

Tutorials on creating and using Hard Links, Soft Links and Junction Points:

Daniel Einspanjer’s journal - How To Use Hardlinks And Junctions In Windows

The Developer’s TidbitWindows File Junctions, Symbolic Links and Hard Links

How-to GeekUsing Symlinks in Windows Vista

Jameser’s Tech TipsTip #37: Creating NTFS Hard Links in Windows XP

Jeff Wouters’s BlogMaking soft and symbolic links in Windows

Maxi-Pedia – Mklink in Windows

TechRepublicVista’s symbolic links feature saves navigating time

 

Share
Bear

Bad Behavior has blocked 675 access attempts in the last 7 days.

Private