Saturday, December 22, 2012

Windows 7 - How to remove lock icon over my folder

SkyHi @ Saturday, December 22, 2012
I got rid of the locks by adding "Authenticated Users" to the security permissions on the directories



REFERENCES
http://www.sevenforums.com/network-sharing/8729-how-remove-lock-icon-over-my-folder.html

Friday, December 21, 2012

Start a New Line Inside a Spreadsheet Cell in Excel

SkyHi @ Friday, December 21, 2012

Sometimes it’s necessary to have more than one line inside a worksheet cell, which is easily done with a line break.
Add a new line by holding down the Alt key while you press enter. It’s the keyboard shortcut Alt+EnterIn Excel 2008 and 2011 for Mac useCmd+Option+Enter.


REFERENCES

How to Create a Bullet List in Microsoft Excel

SkyHi @ Friday, December 21, 2012

To Add a Bullet to an Existing Text Entry

  1. Position the insertion point at the beginning of your text entry.
  2. Type a symbol that you want to use as a bullet. To create the bullet character, press ALT+0149 (type 0149 on the numeric keypad).

    You may want to include a space after the character so that the bullet will not be next to the text. Note that the bullet is an extended character and may not be available with all fonts.

    Some other examples of characters you can use include: >, /, ~, !, and others.

To Create a Custom Text Format That Includes Bullets

  1. Select the cell or range of cells that you want to apply bullets to.
  2. On the Format menu, click Cells.
  3. On the Number tab, click the Text category, and then click the Custom category.

    Microsoft Excel places an at sign (@) in the Type box.
  4. In the Type box, place the insertion point before the @, and type the symbol that you want to use as a bullet. To create the bullet character, press ALT+0149 (type 0149 on the numeric keypad).

    You may want to include a space after the symbol so that the bullet will not be next to the text. Note that the bullet is an extended character and may not be available with all fonts.

    Some other examples of characters you can use include: >, /, ~, !, and others.
  5. Click OK.
Text that you type in cells that are formatted with this custom format will have the bullet applied to them.

REFERENCES
http://support.microsoft.com/kb/323567

screen Quick Reference

SkyHi @ Friday, December 21, 2012

Getting in

start a new screen session with session namescreen -S 
list running sessions/screensscreen -ls
attach to a running sessionscreen -r
… to session with namescreen -r 
the “ultimate attach”screen -dRR (Attaches to a screen session. If the session is attached elsewhere, detaches that other display. If no session exists, creates one. If multiple sessions exist, uses the first one.)

Escape key

All screen commands are prefixed by an escape key, by default C-a (that's Control-a, sometimes written ^a). To send a literal C-a to the programs in screen, use C-a a.

Getting out

detachC-a d
detach and logout (quick exit)C-a D D
exit screen“C-a : quit” or exit all of the programs in screen.
force-exit screenC-a C-\ (not recommended)

Help

See helpC-a ? (lists keybindings)
The man page is the complete reference, but it's very long.

Window Management

create new windowC-a c
change to last-visited active windowC-a C-a (commonly used to flip-flop between two windows)
change to window by numberC-a  (only for windows 0 to 9)
change to window by number or nameC-a '
change to next window in listC-a n or C-a
change to previous window in listC-a p or C-a
see window listC-a " (allows you to select a window to change to)
show window barC-a w (if you don't have window bar)
close current windowClose all applications in the current window (including shell)
kill current windowC-a k (not recommended)
kill all windowsC-a \ (not recommended)
rename current windowC-a A

Split screen

split display horizontallyC-a S
split display verticallyC-a | or C-a V (for the vanilla vertical screen patch)
jump to next display regionC-a tab
remove current regionC-a X
remove all regions but the current oneC-a Q

Scripting

send a command to a named sessionscreen -S  -X 
create a new window and run ping example.comscreen -S  -X screen ping example.com
stuff characters into the input buffer
using bash to expand a newline character
(from here)
screen -S <name> [-p <page>] -X stuff $'quit\r'
a full example
# run bash within screen
screen -AmdS bash_shell bash
# run top within that bash session
screen -S bash_shell -p 0 -X stuff $'top\r'
 
# ... some time later
 
# stuff 'q' to tell top to quit
screen -S bash_shell -X stuff 'q'
# stuff 'exit\n' to exit bash session
screen -S bash_shell -X stuff $'exit\r'

Misc

redraw windowC-a C-l
enter copy modeC-a [ or C-a  (also used for viewing scrollback buffer)
pasteC-a ]
monitor window for activityC-a M
monitor window for silenceC-a _
enter digraph (for producing non-ASCII characters)C-a C-v
lock (password protect) displayC-a x
enter screen commandC-a :
SHIFT+PGUP to scroll up in buffer

REFERENCES
http://aperiodic.net/screen/quick_reference
http://www.saltycrane.com/blog/2008/01/how-to-scroll-in-gnu-screen/

Wednesday, December 19, 2012

Credential Manager in Windows 7

SkyHi @ Wednesday, December 19, 2012

Which Windows Passwords & Credentials Can Be Easily Cracked?

When we published our first article about the Credential Manager, some of you wanted to know how secure is the data stored inside. Can it be easily cracked? We made a few tests and we managed to identify which Windows Vault passwords can be easily cracked and which not. Read more for details.

The Tool Used for Cracking Passwords - Network Password Recovery

First, I would like to introduce Network Password Recovery - a free tool anyone can download and use to view the passwords stored by Windows in its Credential Manager.
Network Password Recovery
When you run it, it shows for each entry in the Credential Manager, its name, type, the username and password used, when it was last written, its alias and the password strength.

What Passwords Are (In)Secure?

The good news is that some passwords are safe and cannot be decrypted. The bad news is that there are more insecure passwords than secure ones.
Network Password Recovery
What passwords are secure? First, the password used by your Homegroup is properly encrypted and cannot be easily identified. Second, are the credentials used for"virtualapp/didlogical", we covered in the previous article: Credential Manager - Where Windows Stores Passwords & Other Login Details.
The bad thing though is that other log-in credentials you ask Windows 7 to remember so that you access shared folders on your network are not secure. They can all be easily read and then the other network computers accessed by unwanted guests who cracked the Credential Manager data on your computer. Therefore, if you have a home network, I highly recommend you to use only the Homegroup feature for sharing folders and devices. Do not share folders using the old ways you’ve grown accustomed to from Windows XP.
The most worrisome aspect is that my Windows Live ID password was not secure. Network Password Recovery was able to easily read it. If an unauthorized program or person is able to read it, it will immediately have access to all the Windows Live services I am using. And there are a whole lot of Windows Live Services they would get access to, including Xbox Live which stores financial data for purchasing games on Xbox.
I hope this will be changed at least in the final version of Windows 8, since the Windows Live IDwill be so central to the whole computing experience. I have tested the Developer Preview of Windows 8 and unfortunately the details of your Windows Live ID are as insecure as in Windows 7. UPDATE: In later updates created for Windows 8 Consumer Preview, this problem no longer exists. It is great to see this improvement in Windows 8.

What Next - Security Recommendations that Will Help?

Considering that most of the information stored in the Credential Manager is insecure, what can you do about it?
First of all, use a strong log-on password for your Windows users accounts. This will make it harder to be cracked with tools that can be easily found on the Internet.
The second piece of advice is to always keep UAC turned on. Also, make sure you have a good security solution installed on your computer. This way, you have a high chance of not getting your computer infected by unwanted malware that aims to steal your personal data.
Third, in case your computer gets stolen, the only real solution to not have it easily cracked is to encrypt it using a solution such as BitLocker or something similar.
Last but not least, if you want to give access to your computer to other people, don’t let them use your user account. Create a separate (non-administrator) account for them, or turn on the standard Guest account. Do not give them access to your administrator account.

Conclusion

Since the data stored in the Credential Manager varies from user to user, it would be good to know: what other passwords do you have stored in the Credential Manager? Which of them are insecure?
Use the Network Password Recovery - make sure you download the appropriate version (32-bit or 64-bit) - and identify the credentials that can be easily cracked and share them with the other readers.
NOTE: Some security products will identify Network Password Recovery as a HackTool, which is entirely true. However, there is no need to worry. It is safe to use it, you won't get your computer infected. You will only be able to hack the passwords stored in the Windows Vault.

Related articles:

linux check mount point

SkyHi @ Wednesday, December 19, 2012
if ! mount | grep -q '/media/backups'; then
    echo "/media/backups not mounted"
    exit 1
fi

Monday, December 17, 2012

WSD port monitor for Printers and TCP/IP ports, what is the difference?

SkyHi @ Monday, December 17, 2012

There is a lot of discussion about IP addresses etc for printer problems. There is no mention of a new feature for porting for printers, WSD port for plug and play of printers, I assume that IP addresses do not matter with WSD, My printer is confusingly set up for WSD port and TCP/IP port, can someone please expain


The WSD Port Monitor is a new printer port monitor in Windows Vista and Windows Server 2008.  This port monitor supports printing to network devices that are designed to include Web Services for Devices (WSD) technology.  Web Services for Devices allows network-connected IP-based devices to advertise their functionality and offer these services to clients by using the Web Services protocol.  WSD-based devices and clients communicate over the network using a series of SOAP (Simple Object Access Protocol) messages over UDP and HTTP(S).  WSD for Devices provides a network plug-and-play experience that is similar to installing a USB device.  Web Services for Devices also defines a security profile that may be extended to provide additional protection and authentication using device-based certificates.
The WSD Port Monitor is installed by default on Windows Vista.  On Windows Server 2008, the port monitor is installed along with the Print Services server role.  Web Services for Devices is not available for Windows XP or Windows Server 2003.  These clients can print to WSD-based devices that are shared on computers running Windows Vista or Windows Server 2008.  There are four main tasks performed by the WSD Port Monitor:
  • Discover and connect to WSD-based network printers
  • Send print jobs to WSD printers
  • Monitor the status and configuration of the WSD printers and update the printer object status accordingly
  • Respond to bidirectional queries from WSD printers
These are the same functions provided by other port monitors (for example the Standard TCP/IP port monitor, tcpmon.dll).  The WSD Port Monitor is implemented in wsdmon.dll.  This DLL is loaded under the print spooler process (spoolsv.exe) and is defined as a port monitor in the following registry key:HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\WSD Port.  For WSD-based print devices, the WSD Port Monitor is used by default.  If the print device does not support the WSD Port Monitor, then the Standard TCP/IP Port Monitor is used instead.
Now that we know what the WSD Port Monitor does, let's look at the communications mechanism used by WSD.  When a WSD-based printer is connected to a network, it sends out an unsolicited "Hello" message to advertise its presence.  Computers running Windows Vista or Windows Server 2008 listen for these advertisements and add the printer to their list of available network printer resources.  When a WSD-based device is gracefully removed from the network it sends another message (a "Bye" message) to advertise that it is no longer available.  In addition, Windows Vista and Windows Server 2008 machines can discover WSD-based printers by using a "Probe" message when searching for printers via Network Discovery or the Add Printer Wizard.  A typical WSD communication sequence is shown below:
WSD-Communication
Let's examine each piece of this sequence:
  1. To find a printer, the client sends a multicast Probe message.  The Probe indicates that the client is looking for a print service.  The probe also indicates whether or not the client requires security.
  2. The WSD-based device listens for Probe messages and responds directly to the client with a Probe Match message since it hosts a print service.
  3. To find out more about the WSD device and what services it hosts, a client sends a Get Metadata message directly to the device using unicast.  Prior to sending a Get Metadata message, a client may also send a Resolve message if the name of the WSD device is known.
  4. The device replies with its metadata.  The metadata may either be in-line within the response message or the device may send a pointer to the metadata.  Besides information like the device manufacturer, serial number and firmware version, the metadata also includes the endpoint reference for each of the services hosted by the device.
  5. To find out more about the print service itself, the client may send a Get Metadata message directly to the service.
  6. The service replies with its metadata, including information about the operations that the service supports and printer-specific metadata (ability to print in color, pages per minute, number and size of paper trays etc).
  7. The client sends a message to start a print job.
  8. The service responds with a status to acknowledge the client request to start a print job.
  9. To receive updates on the status of the job or about the overall status of the print service, the client may send a Subscribe message to the print service.
  10. The Subscribe response message include an identifier for the subscription and when it will expire.  If the client needs status information after the expiration, it has to renew the subscription.
  11. The client sends the print job itself to the print service, encoding large images as attachments to the message.  Attachments are an optimization for transmitting a SOAP message by selectively re-encoding portions of the message while still presenting the required XML to the SOAP application.
  12. The print service responds to indicate that the job has been accepted.
  13. The print service sends an event to the client, informing it of, for instance, a change in the print job, number of pages printed, paper jam, completion etc.
Hello, Bye, Probe, Resolve and Get messages are all generated without network solicitation.  These messages are used to announce device state, issue a search request, or obtain metadata.  ProbeMatches, ResolveMatches, and GetResponse messages are generated in response to Probe, Resolve and Get messages.  Hello, Bye, Resolve and ResolveMatches messages are sent by UDP multicast to port 3702.  Get and GetResponse metadata messages occur over HTTP (TCP port 5357) or HTTPS (TCP port 5358).  Probe and ProbeMatches messages are sent over UDP (port 3702) unless they are "directed" messages.  A "directed" message is one where the WSD device name is known and accessed directly by name.  For directed messages, the Probe and ProbeMatches messages use the same ports as the Get and GetResponse metadata messages.  Obviously, to allow WSD network discovery, the Network Discovery firewall exceptions for the listed ports must be enabled in the Windows Firewall.  Finally, you can disable Multicast by setting the IGMPLevel value to 0 in the following registry key: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
And that brings Day Eleven to a close.  Tomorrow we'll be looking at Printer Driver Packages.  Until next time ...
Additional Resources:

REFERENCES

Wednesday, December 12, 2012

How to make a table in Wikipedia

SkyHi @ Wednesday, December 12, 2012
REFERENCES
http://en.wikipedia.org/wiki/Wikipedia:How_to_make_a_table_in_Wikipedia

Sunday, December 9, 2012

How to Delete an Address from the Outlook Auto-Complete List

SkyHi @ Sunday, December 09, 2012
Outlook remembers every address you have typed in a To:Cc: or Bcc: field. This is good: when you start keying in a name or address, Outlook automatically suggest the contact in its entirety.
Unfortunately, Outlook remembers the mistyped and old as well as the correct and current — and suggest it indiscriminately. Fortunately, getting rid of entries you no longer want to appear in the auto-complete list is easy.

Delete an Address from the Outlook Auto-Complete List

To remove a name or email address from Outlook's auto-complete list:
  • Create a new email message in Outlook.
  • Start typing the name or address you want to remove.
  • Use the down arrow key to highlight the desired (undesired) entry.
  • Press Del.

Want to Edit the Outlook Auto-Complete List?

For more control over Outlook's email address auto-complete file, try a tool like Ingressor.

Prevent Outlook Address Auto-Completion Altogether

You can also stop Outlook from suggesting email addresses as you type:
  • Select Tools | Options... from the menu.
  • Go to the Preferences tab.
  • Click E-mail Options....
  • Now click Advanced E-mail Options....
  • Make sure Suggest names while completing To, Cc, and Bcc fields is not checked.
  • Click OK.
  • Click OK again.
  • Click OK once more.

If the above doesn't work, you have to go "contacts" folder and modify accordingly.

REFERENCES
http://email.about.com/od/outlooktips/qt/et_del_autocomp.htm

Thursday, December 6, 2012

GNU screen Kill detached screen session

SkyHi @ Thursday, December 06, 2012

== ISSUE THIS COMMAND
[xxx@devxxx ~]$ screen -ls


== SCREEN RESPONDS
There are screens on:
        23487.pts-0.devxxx      (Detached)
        26727.pts-0.devxxx      (Attached)
2 Sockets in /tmp/uscreens/S-xxx.


== NOW KILL THE ONE YOU DONT WANT
[xxx@devxxx ~]$ screen -X -S 23487.pts-0.devxxx kill
or
[xxx@devxxx ~]$screen -S 23487 -X quit
== WANT PROOF? [xxx@devxxx ~]$ screen -ls There is a screen on: 26727.pts-0.devxxx (Attached) 1 Socket in /tmp/uscreens/S-xxx.

REFERENCES
http://stackoverflow.com/questions/1509677/kill-detached-screen-session

Friday, November 30, 2012

Windows 7: Japanese not displaying in Windows

SkyHi @ Friday, November 30, 2012
Your problem probably stems from the fact that you're font chache probably is corrupted; delete the fileC:\Windows\system32\FNTCACHE.DAT and restart, your problem should be solved.


Windows XP had a “supplemental language support” section under Regional and Language options. You had to select them and perform the installation (which required the CD and was annoying) if you wanted to work with Asian languages. This was removed with Vista and support for these languages came by default. Windows 7 turns out to be a little different, however.
I usually do not find what Microsoft chooses to hide from the UI very useful. Why do I need to hit the alt key to see the file menu for example? This started with Internet Explorer and seems to be applied to other apps as well, including Windows Explorer. All of a sudden, the menu disappeared… Yes, it provides a little more space on the screen, but that space is not very useful as menu bar is not located at direct eye sight anyway. Does anybody browse the Internet full screen? No.
Lets get back to the Font issue. I launched an html document with Japanese strings in Notepad and was presented with a bunch of boxes! Boxes are how Windows expresses “I don’t know how to display this character”. I went to Format > Font to pick a font which supports Japanese script but none existed! Ah, must be the newest victim of Microsoft hiding team…
Windows 7 hides fonts depending on your language settings. Go to Control panel > Fonts > Font settings and uncheck “Hide fonts based on language settings”
Hiding the fonts is supposed to simplify the font selection in applications. I am not sure which applications are targeted for this but Notepad is definitely not one of them. The font selection dialog has always been and is still far from being user friendly and having 80 fonts instead of 200 doesn’t really provide any improvement.
I picked MS Minco for the font and Japanese for the script and there we go. No more boxes!


REFERENCES
http://superuser.com/questions/372928/windows-7-japanese-not-displaying-in-windows
http://www.emreakkas.com/windows-tips/how-to-enable-hidden-fonts-in-windows-7
http://mangahelpers.com/forum/showthread.php/3709-How-To-Enable-Japanese-Language-Windows

Thursday, November 29, 2012

Find command: Exclude / Ignore Files ( Ignore Hidden .dot Files )

SkyHi @ Thursday, November 29, 2012


Q. How do I ignore hidden .dot files while searching for files? How do I ignore or exclude certain files while running Linux / UNIX find command?

A. Find command support standard UNIX regex to match or exclude files. You can write complex queries easily with regex.

Find command and logical operators

Find any file whose name ends with either 'c' or 'asm', enter:
$ find . -type f \( -iname "*.c" -or -iname "*.asm" \)
The parentheses must be escaped with a backslash, "\(" and "\)", to prevent them from being interpreted as special shell characters. The -type f option force to only search files and not directories. The or operator either find .c or .asm file.

Understanding find command operators

Operators build a complex expression from tests and actions. The operators are, in order of decreasing precedence:
( expr )Force precedence. True if expr is true
expr
-not expr
True if expr is false. In some shells, it is necessary to protect the ‘!’ from shell interpretation by quoting it.
expr1 -and expr2And; expr2 is not evaluated if expr1 is false.
expr1 -or expr2Or; expr2 is not evaluated if expr1 is true.
WARNING! The '-or', '-and', and '-not' operator are not available on all versions of find. Usually GNU find supports all options. Refer your local find command man page for more information.

How do I ignore hidden .dot files while searching for files?

Find *.txt file but ignore hidden .txt file such as .vimrc or .data.txt file:
$ find . -type f \( -iname "*.txt" ! -iname ".*" \)
Find all .dot files but ignore .htaccess file:

REFERENCES
http://www.cyberciti.biz/faq/find-command-exclude-ignore-files/

Find Command Exclude Directories From Search Pattern

SkyHi @ Thursday, November 29, 2012


How do I exclude certain directories while using the find command under UNIX or Linux operating systems?

You can use the find command as follows to find all directories except tmp directory:
find /path/to/dest -type d \( ! -name tmp \) -print
Find all directories except tmp and cache:
find /path/to/dest -type d \( ! -name tmp \) -o \( ! -name cache \) -print
The -prune option make sure that you do not descend into directory:
find /path/to/dest -type d \( ! -name tmp \) -o \( ! -name cache -prune \) -print
You can find all *.pl find except in tmp and root directory, enter:
find /  \( ! -name tmp \) -o \( ! -name root -prune \)  -name "*.pl" -print


References
http://www.cyberciti.biz/faq/linux-unix-osx-bsd-find-command-exclude-directories/

Saturday, November 24, 2012

A Tmux Crash Course

SkyHi @ Saturday, November 24, 2012

I’ve been using Tmux for about six months now and it has become just as essential to my workflow as vim. Pane and window management, copy-mode for navigating output, and session management make it a no-brainer for those who live in the terminal (and especially vim). I’ve compiled a list of tmux commands I use daily to help me work more efficiently.
Tmux Panes
If a tmux command I mention is bound to a keyboard shortcut by default, I’ll note that in parenthesis.

SESSION MANAGEMENT

Sessions are useful for completely separating work environments. I have a ‘Work’ session and a ‘Play’ session; in ‘Work’, I keep everything open that I need during my day-to-day development, while in ‘Play’, I keep open current open-source gems or other work I hack on at home.
tmux new -s session_name
creates a new tmux session named session_name
tmux attach -t session_name
attaches to an existing tmux session named session_name
tmux switch -t session_name
switches to an existing session named session_name
tmux list-sessions
lists existing tmux sessions
tmux detach (prefix + d)
detach the currently attached session

WINDOWS

Tmux has a tabbed interface, but it calls its tabs “Windows”. To stay organized, I rename all the windows I use; if I’m hacking on a gem, I’ll name the window that gem’s name. The same thing goes for client applications. That way, I can recognize windows by context and not what application it’s running.
tmux new-window (prefix + c)
create a new window
tmux select-window -t :0-9 (prefix + 0-9)
move to the window based on index
tmux rename-window (prefix + ,)
rename the current window

PANES

Panes take my development time from bland to awesome. They’re the reason I was able to uninstall MacVim and develop solely in iTerm2. I don’t have to switch applications to switch contexts (editing, reading logs, IRB, etc.) - everything I do, I do in a terminal now. People argue that OS X’s Cmd+Tab is just as fast, but I don’t think so.
tmux split-window (prefix + ")
splits the window into two vertical panes
tmux split-window -h (prefix + %)
splits the window into two horizontal panes
tmux swap-pane -[UDLR] (prefix + { or })
swaps pane with another in the specified direction
tmux select-pane -[UDLR]
selects the next pane in the specified direction
tmux select-pane -t :.+
selects the next pane in numerical order

HELPFUL TMUX COMMANDS

tmux list-keys
lists out every bound key and the tmux command it runs
tmux list-commands
lists out every tmux command and its arguments
tmux info
lists out every session, window, pane, its pid, etc.
tmux source-file ~/.tmux.conf
reloads the current tmux configuration (based on a default tmux config)

MUST-HAVES

These are some of my must-haves in my tmux config:
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf

# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+

WORKFLOW

During the day, I’ll work on one or two Rails apps, work on my dotfiles, run irssi, and maybe run vim in another window to take notes for myself. As I mentioned, I run all of this inside one tmux session (named work) and switch between the different windows throughout the day.
When I’m working on any Ruby work specifically, I’ll have a 75%/25% vertical split for vim and a terminal so I can run tests, interact with git, and code. If I run tests or ‘git diff’ and want to see more output than the 25% allots me, I’ll use tmux to swap the panes and then move into copy mode to see whatever I need to see.
Finally, I run iTerm2 in full-screen mode. Switching between OS X apps for an editor and a terminal is for chumps!



REFERENCES
http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course