CSS Font-Family

Serif Fonts
~~~~~~~~~~
Georgia, serif
“Palatino Linotype”, “Book Antiqua”, Palatino, serif
“Times New Roman”, Times, serif

Sans-Serif Fonts
~~~~~~~~~~~~~~
Arial, Helvetica, sans-serif
“Arial Black”, Gadget, sans-serif
“Comic Sans MS”, cursive, sans-serif
Impact, Charcoal, sans-serif
“Lucida Sans Unicode”, “Lucida Grande”, sans-serif
Tahoma, Geneva, sans-serif
“Trebuchet MS”, Helvetica, sans-serif
Verdana, Geneva, sans-serif

Monospace Fonts
~~~~~~~~~~~~~~~
“Courier New”, Courier, monospace
“Lucida Console”, Monaco, monospace

apt-get

sudo apt-get update
sudo apt-get upgrade

Run from CMD Prompt

Environment Variable Path
%ALLUSERSPROFILE% C:\ProgramData
%APPDATA% C:\Users\{username}\AppData\Roaming
%COMMONPROGRAMFILES% C:\Program Files\Common Files
%COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files
%COMSPEC% C:\Windows\System32\cmd.exe
%HOMEDRIVE% C:
%HOMEPATH% C:\Users\{username}
%LOCALAPPDATA% C:\Users\{username}\AppData\Local
%PROGRAMDATA% C:\ProgramData
%PROGRAMFILES% C:\Program Files
%PROGRAMFILES(X86)% C:\Program Files (x86) (only in 64-bit version)
%PUBLIC% C:\Users\Public
%SystemDrive% C:
%SystemRoot% C:\Windows
%TEMP% and %TMP% C:\Users\{username}\AppData\Local\Temp
%USERPROFILE% C:\Users\{username}
%WINDIR% C:\Windows

Run commands

Calc – Calculator
Cfgwiz32 – ISDN Configuration Wizard
Charmap – Character Map
Chkdisk – Repair damaged files
Cleanmgr – Cleans up hard drives
Clipbrd – Windows Clipboard viewer
Cmd – Opens a new Command Window (cmd.exe)
Control – Displays Control Panel
Dcomcnfg – DCOM user security
Debug – Assembly language programming tool
Defrag – Defragmentation tool
Drwatson – Records programs crash & snapshots
Dxdiag – DirectX Diagnostic Utility
Explorer – Windows Explorer
Fontview – Graphical font viewer
Ftp – ftp.exe program
Hostname – Returns Computer’s name
Ipconfig – Displays IP configuration for all network adapters
Jview – Microsoft Command-line Loader for Java classes
MMC – Microsoft Management Console
Msconfig – Configuration to edit startup files
Msinfo32 – Microsoft System Information Utility
Nbtstat – Displays stats and current connections using NetBios over TCP/IP
Netstat – Displays all active network connections
Nslookup – Returns your local DNS server
Odbcad32 – ODBC Data Source Administrator
Ping – Sends data to a specified host/IP
Regedit – registry Editor
Regsvr32 – register/de-register DLL/OCX/ActiveX
Regwiz – Reistration wizard
Sfc /scannow – Sytem File Checker
Sndrec32 – Sound Recorder
Sndvol32 – Volume control for soundcard
Sysedit – Edit system startup files (config.sys, autoexec.bat, win.ini, etc.)
Systeminfo – display various system information in text console
Taskmgr – Task manager
Telnet – Telnet program
Taskkill – kill processes using command line interface
Tskill – reduced version of Taskkill from Windows XP Home
Tracert – Traces and displays all paths required to reach an internet host
Winchat – simple chat program for Windows networks
Winipcfg – Displays IP configuration

Management Consoles

certmgr.msc – Certificate Manager
ciadv.msc – Indexing Service
compmgmt.msc – Computer management
devmgmt.msc – Device Manager
dfrg.msc – Defragment
diskmgmt.msc – Disk Management
fsmgmt.msc – Folder Sharing Management
eventvwr.msc – Event Viewer
gpedit.msc – Group Policy -XP Pro only
iis.msc – Internet Information Services
lusrmgr.msc – Local Users and Groups
mscorcfg.msc – Net configurations
ntmsmgr.msc – Removable Storage
perfmon.msc – Performance Manager
secpol.msc – Local Security Policy
services.msc – System Services
wmimgmt.msc – Windows Management

Shortcuts

access.cpl – Accessibility Options
hdwwiz.cpl – Add New Hardware Wizard
appwiz.cpl – dd/Remove Programs
timedate.cpl – Date and Time Properties
desk.cpl – Display Properties
inetcpl.cpl – Internet Properties
joy.cpl – Joystick Properties
main.cpl keboard – Keyboard Properties
main.cpl – Mouse Properties
ncpa.cpl – Network Connections
ncpl.cpl – Network Properties
telephon.cpl – Phone and Modem options
powercfg.cpl – Power Management
intl.cpl – Regional settings
mmsys.cpl sounds – Sound Properties
mmsys.cpl – Sounds and Audio Device Properties
sysdm.cpl – System Properties
nusrmgr.cpl – User settings
firewall.cpl – Firewall Settings (sp2)
wscui.cpl – Security Center (sp2)

Windows Environment Commands

%ALLUSERSPROFILE% – Open the All User’s Profile
%HomeDrive% – Opens your home drive e.g. C:\
%UserProfile% – Opens you User’s Profile
%temp% Opens – temporary file Folder
%systemroot% – Opens Windows folder

Wupdmgr – Takes you to Microsoft Windows Update

WordPress – Loop Post Links by Year

Code swiped from http://wordpress.org/support/topic/list-all-posts-on-a-page-split-them-by-year

<?php
// Get years that have posts
$years = $wpdb->get_results( “SELECT YEAR(post_date) AS year FROM wp_posts WHERE post_type = ‘post’ AND post_status = ‘publish’ GROUP BY year DESC” );

// For each year, do the following
foreach ( $years as $year ) {

// Get all posts for the year
$posts_this_year = $wpdb->get_results( “SELECT ID, post_title FROM wp_posts WHERE post_type = ‘post’ AND post_status = ‘publish’ AND YEAR(post_date) = ‘” . $year->year . “‘” );

// Display the year as a header
echo ‘<h2>’ . $year->year . ‘</h2>’;

// Start an unorder list
echo ‘</ul>’;

// For each post for that year, do the following
foreach ( $posts_this_year as $post ) {
// Display the title as a hyperlinked list item
echo ‘<li><a href=”‘ . get_permalink($post->ID) . ‘”>’ . $post->post_title . ‘</a></li>’;
}

// End the unordered list
echo ‘</ul>’;
}
?>

Display headers in outlook message

Outlook 2007/2010/2013
You can display full headers by double clicking on a message so that it opens in a separate window (not the preview pane).

Start Outlook.
Double-click the message for which you want to view full internet headers.
Click Options (2007) or Tags (2010/2013).

message options button /

The Message Options dialog box is displayed. The internet headers are shown in the Internet headers field at the bottom of the dialog box.

PHP keywords

http://php.net/manual/en/reserved.keywords.php

Posted in: PHP

Open MYSQL for remote connections

https://rtcamp.com/tutorials/mysql/remote-access/

Change mysql config

Start with editing mysql config file

vim /etc/mysql/my.cnf

Comment out following lines.

#bind-address           = 127.0.0.1
#skip-networking

If you do not find skip-networking line, add it and comment out it.

Restart mysql server.

service mysql restart

Change GRANT privilege

You may be surprised to see even after above change you are not getting remote access or getting access but not able to all databases.

By default, mysql username and password you are using is allowed to access mysql-server locally. So need to update privilege.

Run a command like below to access from all machines.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

Run a command like below to give access from specific IP.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'1.2.3.4' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

You can replace 1.2.3.4 with your IP. You can run above command many times to GRANT access from multiple IPs.

You can also specify a separate USERNAME & PASSWORD for remote access.

You can check final outcome by:

SELECT * from information_schema.user_privileges where grantee like "'USERNAME'%";

Finally, you may also need to run:

mysql> FLUSH PRIVILEGES;

Test Connection

From terminal/command-line:

mysql -h HOST -u USERNAME -pPASSWORD

If you get a mysql shell, don’t forget to run show databases; to check if you have right privileges from remote machines.