Monday, October 15, 2018

GMail Search & Filters : Search Syntax + some filter examples to auto label emails

References:

Gmail Filters : Exhaustive Syntax Documentation

Some advanced Gmail Filter topics

** Note ** : Gmail does NOT support search using partial matches, instead GMail

only supports while word searches.  E.g: This does not work: “Find emails that contain any word that starts with Driv%” , The

To and From are the only fields that allow p[artial searching, e.g: find emails that are from @ally.com

Searching:

1. Search Examples using GMails Search Syntax Examples:

Just copy aand paste the below searches into the Gmail search text box to test
  From is from a certain domain:
         from:(@ally.com)
         from:(@ally.com | @expediamail.com)
         same as
         from:(@ally.com OR @expediamail.com)
        
   Before/After Date
         before:2018/9/1
         after:2018/9/1 before:2018/11/18
        
   Before/After Relative Date (instead of specific date)
         newer_than:2d
         older_than:30d
    
   Search multiple labels!
         label:(sent OR inbox)
         label:(sent OR inbox) Indeed
         label:(awork-jobs OR awork-jobs-jobsites) Indeed
         label:(awork-jobs OR awork-jobs-jobsites) older_than:30d

Filtering and Labels

1. Create Gmail Filter to auto label incoming emails:

Requirement:

When an incoming email is received the email shall be saved to a label .\AWork\Jobs\Insurance if the email contains the word Cigna and if the email was not sent from jdoyle@MyDomain.NET

(Create the label first if it does not exist)

How to Build step by Step:

Search:

from:(-from jdoyle@MyDomain.NET) Cigna


Filter:

image_thumb[9]

2. Gmail Filters Syntax


Gmail Filter Syntax Examples for and/or searching:

OR
     to:adam OR subject:iPhone
     is same as
     {to:adam subject:iPhone}


AND
     to:adam AND subject:iPhone
     is same as
     to:adam subject:iPhone
     is same as
     (to:adam subject:iPhone )
   
() parens -> AND
{} brackets -> OR
    


3. Create advanced Filter to auto label incoming emails:

e.g: I need to move emails from Inobx into, I want to move emails based on following requirements:

If incoming email contains the words job or opportunity or contract and email is NOT from a job site alert, then save email to .\AWork\Jobs


If incoming email contains the words job or opportunity or contract and email is NOT from a job site alert AND email has the word Melbourne in it, then save email to .\AWork\Jobs\Melbourne


If incoming email contains the words job or opportunity or contract and email is NOT from a job site alert AND email has the word remote or telecommute in it, then save email to .\AWork\Jobs\Remote



.\AWork\Jobs

(job | opportunity | contract) -{remote from:{alert@indeed.com alerts@ziprecruiter.com inmail-hit-reply@linkedin.com noreply@updates.freelancer.com noreply@updates.freelancer.com info@mail.glassdoor.com noreply@glassdoor.com dartcontainer-jobnotification@noreply.jobs2web.com}} -in:chats


Looks like this:

image_thumb[1]


.\AWork\Jobs\Melbourne

Search:

Find all job emails for melbourne area that are NOT from an automated job site like indeed or ziprecruiter and not in my chats.

(in:anywhere (job | opportunity | contract) (melbourne | "Palm Bay" | Cocoa) -subject:Enterprise -("car rental") -{remote from:{alert@indeed.com alerts@ziprecruiter.com inmail-hit-reply@linkedin.com noreply@updates.freelancer.com noreply@updates.freelancer.com info@mail.glassdoor.com noreply@glassdoor.com dartcontainer-jobnotification@noreply.jobs2web.com}} -in:chats)

Filter:

image_thumb[3]


.\AWork\Jobs\Remote

Search:

((remote | telecommuting | telecommute | remoting) -from:{jdoyle@jrdtechnologies.net alert@indeed.com alerts@ziprecruiter.com inmail-hit-reply@linkedin.com noreply@updates.freelancer.com noreply@updates.freelancer.com info@mail.glassdoor.com noreply@glassdoor.com dartcontainer-jobnotification@noreply.jobs2web.com})


Filter:

image_thumb[5]

When saving a filter be sure to use these options to move an email to a label:

image_thumb[7]

Google Search:

below applies to Google search

1. Google Search by date:

image

 

FYI:

Why Searching using Wildcard in Gmail doesn’t work and some alternatives

https://www.labnol.org/internet/advanced-gmail-search/21623/

http://sirlagz.net/2015/04/27/searching-gmail-with-wildcards/

(online2|online3|online4).provider.com

Thursday, October 11, 2018

Windows 10 : Stop Network Shares from dropping between restarts

you may notice that the network/mapped drives are randomly disappearing. A logoff/login will fix it temporarily, but what a pain. This is how you permanently fix the vanishing drives.


Registry Method

Use this method to change default time-out period of autodisconnect .

  1. Run |  regedit

  2. Locate and then click the following key in the registry:

  3. autodisconnect

Key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters

Value:

Value: autodisconnect
Data type : REG_DWORD
Range : Hexadecimal
Default value: ffffffff

4. KeepConn : Change time-out the client-side during a UNC connection, specify in KeepConn. Locate and then click the following key in the registry:


Key:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]

Value:

Value: KeepConn
Data type : REG_DWORD
Range : 1 to 65535 (sec)
Default value: 600 sec = 10 mins

Command Line Method

1. autodisconnect  :

change the default time-out period for the autodisconnect feature of the Server service,

2. Run | cmd as Admin


3. Type following cmd:

net config server /autodisconnect:-1

net config server /autodisconnect:number

More info:

0 = the autodisconnect feature is not turned off

-1 = the autodisconnect feature is turned off

1-65,535 =  number is the number of minutes that you want the server to wait before it disconnects a mapped network drive

4. Windows 10 only:

This can the SMB issues with dropping network shares:open a administrator command prompt and type the following hitting enter after each line.


sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi
sc.exe config mrxsmb20 start= disabled

then Restart the computer

To reverse :


sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi
sc.exe config mrxsmb20 start= auto
then Restart the computer


Others:

1. Network Adapters:

I've found that by turning off the network card's power saving features I've not been losing the drives.

2. Group Policy :

Group Policy drives which are set to "Recreate". Windows 8/10 automatically runs Group Policy updates in the background and disconnects/reconnects the drive to Recreate it.

Change the drive to "Update" in group policy and the issue will disappear!

Run | gpedit.msc:

User Configuration > Preferences > Windows Settings > Drive Maps

Change the drive to “Update” in group policy

See example here


3. Run a custom .bat file on login and network connect:


- FixMappedDrives.bat

Sample file below, this connects to mapped drives based on loginid of user, in this case I am hard coding a userid to a mapped drive credential. This could be altered to use dynamic credentials based on userid and lookup up creds based on current logged in user.

- task Scheduler

Run bat fule on following events:

A) Login and

StartUp using StartUp folder or Task Scheduler Logon event

B) Network connect

Task Scheduler task: Network connect event


- Sample files:


FixedMapDrives.bat


@echo off
echo MyFileServer:MapDrives Login Script START

echo MyFileServer:MapDrives Checking connection to MyFileServer....
ping -n 10 MyFileServer > nul
echo MyFileServer:MapDrives done Checking connection to MyFileServer.... Error: %errorlevel%

if %errorlevel% == 0 (
     echo MyFileServer:MapDrives CONNECTED
     goto connected
) ELSE (
     echo MyFileServer:MapDrives ERROR- Not Connected
     goto end
)


:connected
     echo MyFileServer start Map Drives for user %username%...
     echo off
       net use * /delete /yes
      
    
     IF /i NOT "%username%"=="User1" GOTO NEXT1
         echo MyFileServer:MapDrives Add DoyleJ mapped drives
         net use * /delete /yes
         NET USE M: \\MyFileServer\homes\User1  /USER:MyFileServer\User1 SomePassword
         NET USE Y: \\MyFileServer\Public  /USER:MyFileServer\User1 SomePassword
         NET USE P: \\MyFileServer\Photo  /USER:MyFileServer\User1 SomePassword
         NET USE V: \\MyFileServer\Video  /USER:MyFileServer\User1 SomePassword
       GOTO ENDIF
    
     :NEXT1
     IF /i NOT "%username%"=="user2" GOTO NEXT2
         echo Add user2
         echo off
           net use * /delete /yes
           NET USE M: \\MyFileServer\homes\user2  /USER:MyFileServer\user2 SomePassword
         NET USE Y: \\MyFileServer\Public  /USER:MyFileServer\user2 SomePassword
         NET USE P: \\MyFileServer\Photo  /USER:MyFileServer\user2 SomePassword
         NET USE V: \\MyFileServer\Video  /USER:MyFileServer\user2 SomePassword
       GOTO ENDIF
    
      
     :NEXT2
         echo Add Public
         echo off
           net use * /delete /yes
         NET USE Y: \\MyFileServer\Public  /USER:MyFileServer\User1 SomePassword
       GOTO ENDIF
    
     :ENDIF
    
:end

echo MyFileServer Login Script DONE

- Powershell


FixedMapDrives.ps1

$i=3
     while($True){
     $error.clear()
     $MappedDrives = Get-SmbMapping |where -property Status -Value Unavailable -EQ | select LocalPath,RemotePath
     foreach( $MappedDrive in $MappedDrives)
     {
         try {
             New-SmbMapping -LocalPath $MappedDrive.LocalPath -RemotePath $MappedDrive.RemotePath -Persistent $True
         } catch {
             Write-Host "There was an error mapping $MappedDrive.RemotePath to $MappedDrive.LocalPath"
         }
     }
     $i = $i - 1
     if($error.Count -eq 0 -Or $i -eq 0) {break}

    Start-Sleep -Seconds 30

}

Thursday, September 27, 2018

Convert Excel Files to CSV in batch via context menu : Convert Many Excel files to CSV in 1 click

RunDTech.XLStoCSV.ReadMe

Summary: Convert xls and xlsx files to csv via a batch menu
Code: C#


1. Copy this folder to C:\Temp\DTech.XLStoCSV\
2. you should see this in C:\Temp\DTech.XLStoCSV\ http://prntscr.com/kzn325
3. Run reg file RunDTech.XLStoCS.reg
4. Right click on the "C:\Temp\DTech.XLStoCSV\Test" folder (if any issues copy test folder to C:\Temp\Test
5. You should see http://prntscr.com/kzn372
6. Click the XLStoCSV menu.
7. You should see the below output


     C:\Temp\DTech.XLStoCSV>"C:\Temp\DTech.XLStoCSV\RunDTech.XLStoCSV.bat" C:\Temp\Te
     st
      ******* Start DTech.XLStoCSV.64.exe C:\Temp\Test  Thu 09/27/2018 23:55:19.84
     DTech.XLStoCSV START
     START CSV  C:\Temp\Test\1.xlsx
     DONE CSV  C:\Temp\Test\1.xlsx
     START CSV  C:\Temp\Test\2.xls
     DONE CSV  C:\Temp\Test\2.xls
     DTech.XLStoCSV DONE
      ******* Start DTech.XLStoCSV.32.exe C:\Temp\Test  Thu 09/27/2018 23:55:19.93
     DTech.XLStoCSV START
     START CSV  C:\Temp\Test\1.xlsx
     DONE CSV  C:\Temp\Test\1.xlsx
     START CSV  C:\Temp\Test\2.xls
     DONE CSV  C:\Temp\Test\2.xls
     DTech.XLStoCSV DONE
     ****************DONE  Thu 09/27/2018 23:55:19.98 synch
    
     8. If you encounter any error try downloading MS Access Redist kit
https://www.microsoft.com/en-us/download/details.aspx?id=13255

9. I wrote this code in 1 night, tested on over 50 xls and xlsx files


Download Here

Wednesday, September 26, 2018

Chrome Extensions to improve Data Entry Productivity:

Chrome Extensions to improve Data Entry Productivity:

These tools make the difference between 30 minutes checking checking boxes or spending 1 minute on a form and the other 29 min doing what U want.Save TIME!!

Anyone needing assistance feel free to contact me, if U think there is a task that is repetitive then most likely there is a tool to make your life easier!! Whether it be eBay forms or filling out a PO or entering data into SalesForce, if u are entering data into web based forms, there is an Extension to speed up ur work productivity. (or we can write code if there isn’t one.)

Access your chrome extensions here

Forms Productivity:

1. Checkbox checker, this allows user to check many checkboxes on a form using mouse point,simply left click and drag over the checkboxes,

Online Tutorial

2. Auto Expander: this is so awesome!! use this to create macros for text you write over and over again, such as signatures, descriptions, names ect ect. This known as text expansion, basically its a macro tool to help to input data into forms QUICKLY!!

Online Tutorial

This is how I setup my Auto Expander (also see Figure 1 below)

3. AutoFill: Use this to create advanced Auto Filling of forms, this combined with Auto Expander helps fill any UI.

Online Tutorial

This is how I setup AutoFill and used it with Auto Expander

4. Fillr: Use for auto fill of name, address, emails, personal data. Good for shopping.

** Sandbox Test Forms , to experiment: Contact Form Example and a Survey Form Example


Email + Other Extension,

Boomerang : Schedule email in the future

Batch Multi Forward: Forward MULTIPLE emails to a recipient in 1 click,

Copy All Urls : BOOM copy / paste hundreds of urls in 1 click!!!!!!!

Auto Refresh tabs, use this to refresh screen every Thumbs down seconds


Figure 1:Auto Text Expander

image

Figure 2: AutoFillOptions:

image

Figure 3: AutoFill Profile

image

ShareX hotKeys compatible with Lightshot Hotkeys

ShareX hotKeys compatible with Lightshot Hotkeys

Use below settings top ensure that you can use both apps at same time, use keyboard keys to capture screen shots + recordings reliably.

The main thing we want is to ensure that Lightshot Printscreen does not interfere with ShareX Print screen, we can do this by creating mutually exclusive hotkeys.

Lightshot:

PrintScr key: used for lightshot since lightshot is great for capture / sharing and annotating screen image captures.

ShareX:

Shift + Print :I use Shift + Print screen to capture images for ShareX and combinations of

Shift + F7 and CTRL+Shift+F7 for screen recording.

Then only keys u have to remember is: Capture Screen: PrintScr Record Screen: Shift+F7 (or Ctrl+Shift+F7)

Set the hotkeys

See this video tutorial here

*** Remember that uploaded screen recordings can be viewed as a Video by simply adding a v to url:

https://i.imgur.com/IqtkYYz.gif

https://i.imgur.com/IqtkYYz.gifv


Lightshot:

1.Open lightshot

2. Select Option

3. Hotkeys tab

4. DeSelect the “Auto save…” item

5. Set the main Hotkey to PrintScr

6. End result:

clip_image002

ShareX:

1. RightClick ShareX in Notification area

2. Set Options see Figure 1 below

3. Select Hotkey settings, See Figure 2 below

4. Set hotkeys as follows:

Figure 1:

clip_image004

Figure 2:

clip_image006

Tuesday, September 25, 2018

Text Replace Trick and Tips

TextPad: Add Line Breaks at ], characters

  1. Click Ctrl + h or Search -> Replace on the top menu
  2. Under the Search Mode group, select Regular expression
  3. In the Find what text field, type ],\s*
  4. In the Replace with text field, type ],\n
  5. Click Replace All


TextPad: How to Add extra Line breaks at end of each line

You can quickly do this by using a feature called "Regular Expressions" to find and add empty lines.

  1. Open up the Find/Replace (Search menu > Replace)
  2. In the "Find what" field, type the following: (^.+$)\n(^.+$)
  3. In the "Replace with" field, type the following: \1\n\n\2
  4. Tick the "Regular expression" checkbox
  5. Click the Replace All button at least twice, but perhaps 3 times, until you get the message Cannot find the Regular Expression
  6. Untick the "Regular expression" checkbox
  7. Close the Replace dialog
  8. Confirm the file is formatted as you are expecting
  9. Save the file.

TextPad: Replace Line Break with a comma

Here is an example document with random words:

document with words in multiple lines

And you fire the replace operation by hitting F8.
Find What: type \n
Replace with: type , (or whatever character you need)

Check "Regular Expression" box before you search / replace

And it will be all merged on to the same line. This looks simple while for an user trying to do this on a several hundred line file, would give big sigh of relief after learning this.

Final result after the replace operation

TextPad: How to Remove All Lines Except the Ones Containing a Pattern

Similar to NotePad,[1] you can remove all lines except the ones containing a pattern in TextPad.[2,3] There is an easy way to achieve this. Basically, you need to perform 3 steps:

  1. Bookmark all lines containing a pattern
  2. Inverse bookmark
  3. Delete all bookmarked lines

Bookmark All Lines Containing a Pattern


For this demonstration, we want to remove all lines except the ones containing the following pattern:
  • "concurrent-mark-end"
To bookmark all lines containing a pattern:
  1. Go to Menu "Search" and select "Find..."  
  2. Specify the pattern in "Find what:" and select "Regular expression"
  3. Hit Button "Mark All"

Inverse Bookmark


To inverse bookmark, do:
  • Go to Menu "Search" and select "Inverse Bookmarks"
You should see some lines are marked and some not.

Delete All Bookmarked Lines


To delete all bookmarked lines, do:
  1. Go to Menu "Edit" and select "Delete > Bookmarked Lines"
and you should see the final results below:


RegEx Summary


Summary of regular expressions:
Default Operator: POSIX Operator: Description:
. . Any single character. Example: h.t matches hat, hit, hot and hut.
[ ] [ ] Any one of the characters in the brackets, or any of a range of characters separated by a hyphen (-), or a character class operator (see below). Examples: h[aeiou][a-z] matches hat, hip, hit, hop, and hut; [A-Za-z] matches any single letter; x[0-9] matches x0, x1, …, x9.
[^] [^] Any characters except for those after the caret "^". Example: h[^u]t matches hat, hit, and hot, but not hut.
^ ^ The start of a line (column 1).
$ $ The end of a line (not the line break characters). Use this for restricting matches to characters at the end of a line. Example: end$ only matches "end" when it's the last word on a line, and ^end only matches "end" when it's the first word on a line.
\< \< The start of a word.
\> \> The end of a word.
\t \t The tab character.
\f \f The page break (form feed) character.
\n \n A new line character, for matching expressions that span line boundaries. This cannot be followed by operators '*', '+' or {}. Do not use this for constraining matches to the end of a line. It's much more efficient to use "$".
\xdd \xdd "dd" is the two-digit hexadecimal code for any character.
\( \) ( ) Groups a tagged expression to use in replacement expressions. An RE can have up to 9 tagged expressions, numbered according to their order in the RE. The corresponding replacement expression is \x, for x in the range 1-9. Example: If \([a-z]+\) \([a-z]+\) matches "way wrong", \2 \1 would replace it with "wrong way".
* * Matches zero or more of the preceding characters or expressions. Example: ho*p matches hp, hop and hoop.
? ? Matches zero or one of the preceding characters or expressions. Example: ho?p matches hp, and hop, but not hoop.
+ + Matches one or more of the preceding characters or expressions. Example: ho+p matches hop, and hoop, but not hp.
\{count\} {count} Matches the specified number of the preceding characters or expressions. Example: ho\{2\}p matches hoop, but not hop.
\{min,\} {min,} Matches at least the specified number of the preceding characters or expressions. Example: ho\{1,\}p matches hop and hoop, but not hp.
\{min,max\} {min,max} Matches between min and max of the preceding characters or expressions. Example: ho\{1,2\}p matches hop and hoop, but not hp or hooop.
\| | Matches either the expression to its left or its right. Example: hop\|hoop matches hop, or hoop.
\ \ "Escapes" the special meaning of the above expressions, so that they can be matched as literal characters. Hence, to match a literal "", you must use "". Example: \< matches the start of a word, but \\< matches "\<".
Character Class Operators "[: ... :]":
These can be used in class expressions as an alternative way of representing classes of characters. For example, [a-z0-9] is equivalent to [[:lower:][:digit:]]. (Note the extra pairs of brackets.) The defined classes are:
Expression: Description:
[:alpha:] Any letter.
[:lower:] Any lower case letter.
[:upper:] Any upper case letter.
[:alnum:] Any digit or letter.
[:digit:] Any digit.
[:xdigit:] Any hexadecimal digit (0-9, a-f or A-F).
[:blank:] Space or tab.
[:space:] Space, tab, vertical tab, return, line feed, form feed.
[:cntrl:] Control characters (Delete and ASCII codes less than space).
[:print:] Printable characters, including space.
[:graph:] Printable characters, excluding space.
[:punct:] Anything that is not a control or alphanumeric character.
[:word:] Letters, hypens and apostrophes.
[:token:] Any of the characters defined on the Syntax page for the document class, or in the syntax definition file if syntax highlighting is enabled for the document class.
Example:
HTML tags are in matched pairs of <…>, such as <FONT SIZE=+1>. To match any tag that begins and ends on the same line, use the regular expression:
<[^>]*>
This matches a "<", followed by zero or more characters, excluding ">", followed by a ">". Note that "*" finds the longest matching sequence on a line, so the regular expression:
<.*>
would be incorrect, because it would not stop at the first ">", if there was more than one on the line.
For more information and examples, see regular expressions, and replacement expressions in the Reference section.

Friday, September 21, 2018

Compare Expensify vs XPenditure side by side Receipt scanning results

This is an update to last blog pot RE receipts, Im going with Expensify for Receipts and MoneyLuver for daily budgeting. Ill update in a year on how it goes

Xpenditure Ill pass on for now,..it has too much and not enough in OCR Categorizing

Compare Android Receipt Apps

and

PC Mags Comparison of Expense Tracking Apps

image