Tuesday, May 12, 2015

String to Bool in Swift

To convert String to Bool in Swift, add following extension

extension String {
    func toBool() -> Bool{
        if self == "false" {
            return false
        }else{
            return true
        }
    } 

Thursday, October 4, 2012

Wifi on Ubuntu Desktop

wireless networks: device not ready (firmware missing).
sudo apt-get update
sudo apt-get install firmware-b43-installer (OR firmware-b43-lpphy-installer) 

This will install the firmware needed to make Broadcom wireless card work.

Also make sure which wireless card is present.
 (Use lspci to find, in my case
Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY)

Hide User Account on Windows logon

under this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList

match the exact user account name,
and the value is one of the following (Decimal format)
0 – Hides the user just from the welcome screen
1 – The user is shown

Mic not working on Ubuntu 12.04

reinstall/install PulseAudio Volume Control (pavucontrol) (volume control tool (mixer) for the PulseAudio sound server)

sudo apt-get update
sudo apt-get install pavucontrol

Wednesday, July 4, 2012

Authenticating HTTP access to website


1) Edit .htaccess file as follows:

Order Deny,Allow
Satisfy All

# BASIC BLOCK - Note you may need AuthDigestFile instead of AuthUserFile
AuthType Basic
AuthName "Auth Name" #e.g.protected by apache
AuthUserFile physical path to .htpasswd file  #e.g. C:/xampp/htdocs/~/.htpasswd
Require user username

2) Use following command to generate .htpasswd file
htpasswd -c .htpasswd username

3) Place .htaccess file in the directory which needs authentication access