| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions! Dokkio, a new product from the PBworks team, integrates and organizes your Drive, Dropbox, Box, Slack and Gmail files. Sign up for free.

View
 

TechNotes

Page history last edited by peterga 5 years ago

 


 

CMD Syntax

 

  • Run command as administrator
    • Search for cmd
    • Right click on cmd.exe
    • Click Run as administrator  
  • Copy - Right-click/Mark/highlight/Enter
  • Turn on Properies/Quick Edit Mode to copy with just highlight/enter and paste with right click
  • Repeat last command - up arrow
  • Mounting share drive
    • \10.xx.xx.xxplatform_support
    • Username: hostingu154314h
  • Press enter to continue - pause
  • Arguments to bat files (including drag and drop) = %1 %*
  • net use - tells you what partitions you have mounted
  •  findstr /si password *
    • (recursive, case-insenstive) 
  • dir /s /b | findstr /iv .java
    • (find files that do not contain .java in names)
    • dir -  /s list sub directories,  /b = bare, no header/summary info

 

Handy net utilities

 

 

Misc Utilities

 

  • gunzip -c (sends to standard out)
  • pscp -pw mypassword wamu-logo.jpg u154314@10.174.17.42:
    • Copy local file to server (don't forget colon at end, optionally follow colon with path)

 

Shellscript

 

Scripts

 

General

 

  • To input one line at a time instead of one word at a time (e.g. "for line in")
    • Set IFS="[newline]"
  • set/debug options
    • set -vx # prints commands before execution
    • set -e # terminate the script at first error
    • set -u # unset variables are fatal errors
  • Sort file based on field 2 with fields delimited by commas
    • sort -t, +1 file
  • Same sort but use numeric values in sorting
    • sort -n -t ':' +2 file
  • Convert text to all uppercase
  • Loop through file one line at a time
while read line

do

(do stuff to line)

done < inputfile

 

sed

  • sed portions of lines
    • Use \(pattern\) and output with \1 \2, etc.
      • E.g.  sed 's/..*\(.......onEvent\)..*/\1/'
  • join selected lines - e.g. when a line ends with xxx, merge with subsequent line:
    • sed ':a;/xxx$/{N;s/\n//;ba}'
      • In a loop (branch ba to label :a), if the current line ends in xxx (/xxx$/) append next line (N) and remove inner newline (s/\n//).

 

 

awk 

  • Newline conversion
    • IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
      • awk '{sub(/\r$/,"");print}' # assumes EACH line ends with Ctrl-M
    • IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format
      • awk '{sub(/$/,"\r");print}
    • IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format
      • awk 1
    • IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
      • Cannot be done with DOS versions of awk, other than gawk:
      • gawk -v BINMODE="w" '1' infile >outfile
    • Use "tr" instead.
      • tr -d \r outfile # GNU tr version 1.22 or higher
  • concatenate every 5 lines of input, using a comma separator between fields
    • awk 'ORS=%NR%5?",":"n"' file
  • print the first three fields of a csv file, (with no " around values)
    • awk -F"," '{gsub(/"/, ""); print $1 " " $2 " " $3}'
  • Do the same but convert first field to uppercase and 3rd to lowercase
    • awk -F"," '{gsub(/"/, ""); print toupper($1) " " $2 " " tolower($3)}'
  • Merge each line that ends with 0 with the following line
    • awk '{while(/0$/) { getline a; $0=$0 a; sub(/\n/,_) }; print}'

 

grep

  • multiple patterns
    • egrep 'pattern1|pattern2'   OR   grep -E ...    OR grep -F file-of-patterns

 

openssl

 

for i in `cat list2.txt`;

do echo $i VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV>> all_sites.txt;

openssl s_client -host $i -port 443 < quit.txt >> all_sites.txt 2>&1;

echo $i ^^^^^^^^^^^^^^^^^^^^^^^^^^ >> all_sites.txt;

done

quit.txt contains: quit<CR>

 

 

Cygwin, Windows quirks

 

  • CygwinStartupScript
  • vim replacement
    • :g,x,s,,y,g - doesn't work
    • :g,x,s//y/g - works
  • Commands with duplicates in path: find, sort

 

 


Excel

  • Examples of Common Formulas
  • Counting functions
  • Date arithmetic
  • Lookup functions
  • =SUMPRODUCT(--(Master!$H$3:$H$1000="reported"),--(Master!$C$3:$C$1000=C1))
    • Count rows in the Master sheet where column H=reported and column C = contents of C1
  • =IF(A3 > B3,"A is larger","B is larger")  
    • Basic IF structure
  • =IF(AND(E29>0)*(D29>E29),DATEDIF($E29,$D29,"d"),"") 
  • =SUMIF(A2:A29,E2,C2:C29)
    • Sum of C2-C29 when the corresponding values in A2-A29 = the value in E2
  • =SUM(($A$2:$A$29=$E3)*($B$2:$B$29=F$2)*($C$2:$C$29))
    • Sum of C2-C29 when A=E3 AND B=F2
    • Install the Conditional Sum Wizard 
    • Braces { } inserted around array formula - to insert use CTRL-SHIFT-ENTER instead of ENTER
  • =VLOOKUP(A1,Master!$A$2:$H$509,8,FALSE)
    • Args = Value to match, grid of vertical list to search, column of grid to return value from, FALSE = exact matches only
    • The 8th column is within the preceding search grid, not the sheet  
    • Without False/0 argument, lookup will return largest of smaller values rather than error (LOOKUP will always do this)
    • Use HLOOKUP for horizontal list
    • LOOKUP results will be screwed up if search column is not sorted 
  • {=MEDIAN(IF(Stats!$A$3:$A$25="reported",IF(Stats!$B$3:$B$25>6,Stats!$B$3:$B$25,0),FALSE))}
    • Take median value of B column when > 6 and column A = "reported"   (use CTRL-SHIFT-ENTER for array function)
  • Do not display error messages
    • Conditional Formatting / New Rule / Format only cells that contain / Errors / set font to white
  • Remove error indicators (green triangles)
    • Office Button / Excel Options / Formulas / uncheck Enable background error checking
  • Use a variable for sheet name in formula
    • =INDIRECT("'" & $A23 & "'!$K$15")
    • (A23 = cell containing name of sheet, $K$15 = target cell on that sheet)

 

 

Vservers/Hosting

 

  • Blocking relayed spam
    • save emails to disk and grep (originating) IP
    • http://216.122.248.78/vadmin/
    • Mail Management / Access Control / Add Access Rules
    • Add DISCARD rule for IP range, e.g. 64.224.219.
    • Restart sendmail

 

Web Utilities

 

AD queries

  • dsquery user -name u154314 | dsget user -memberof | find /i "bfss" | dsget group -members
  • Get object for me | Find groups I'm a member of | grep bfss | List the members of that group
  • dsquery group "OU=Mail Lists,OU=WAMU Mail,DC=us,DC=wamu,DC=net" -name "DL ecommerce technology Minstry of Information*" | dsget group -members
    • (Get members of a DL)

 

Networking, IP

Find server name with IP - nslookup xx.xx.xx.xx

 

Shinn, William M. says:

here's your $20,000 subnet calculator.... but I'll give it to you for free:

CIDR/bit mask:25 26 27 28 29 30 31 32

Decimal mask:128 192 224 240 248 252 254 255

number of hosts per subnet: 128 64 32 16 8 4 2 1

 

Andrijeski, Peter says:

So stuff in the 252 range can only contain 4 hosts?

Shinn, William M. says:

yup

Shinn, William M. says:

if the mask is 255.255.255.252, that network will only have 2 hosts.

the first address will be the subnet address, then 2 host addresses, then a broadcast address

that's why on serial links between you and a provider (for example, at least in very small

networks) you usually get a .252 subnet... subnet address, providers router (ser0) and your

router (ser0), then the broadcast address

then they route your public IP ranges to your serial interface

 

 

iPod

  • Fast forward: Hit center button to toggle bar

 

 

iPad

  • Get seattlebars into iNumbers
    • Send to gmail
    • Select attachment - Open with

 

Fonts

  • Installing on Gateway:   Control Panel / Fonts / File / Install Fonts  (downloads in /_install/fonts/ )

 

 

Windows

  • Stopping Services: File Explorer / My Computer / right-click: Manage / Services and Applications / Services / right-click on service / Stop
  • Edit hosts file - Windows 7
    • %systemroot%\system32\drivers\etc\hosts -  /Windows/System32/drivers/etc
    • Right click on Notepad and choose Run as administrator 

 

 

MAC / Apple

 

 

Texting Addresses

 

Alltel [10-digit phone number]@message.alltel.com
Example: 1234567890@message.alltel.com
AT&T (formerly Cingular) [10-digit phone number]@txt.att.net
[10-digit phone number]@mms.att.net (MMS)
[10-digit phone number]@cingularme.com
Example: 1234567890@txt.att.net
Boost Mobile [10-digit phone number]@myboostmobile.com
Example: 1234567890@myboostmobile.com
Nextel (now Sprint Nextel) [10-digit telephone number]@messaging.nextel.com
Example: 1234567890@messaging.nextel.com
Sprint PCS (now Sprint Nextel) [10-digit phone number]@messaging.sprintpcs.com
[10-digit phone number]@pm.sprint.com (MMS)
Example: 1234567890@messaging.sprintpcs.com
T-Mobile [10-digit phone number]@tmomail.net
Example: 1234567890@tmomail.net
US Cellular [10-digit phone number]email.uscc.net (SMS)
[10-digit phone number]@mms.uscc.net (MMS)
Example: 1234567890@email.uscc.net
Verizon [10-digit phone number]@vtext.com
[10-digit phone number]@vzwpix.com (MMS)
Example: 1234567890@vtext.com
Virgin Mobile USA [10-digit phone number]@vmobl.com
Example: 1234567890@vmobl.com

 

 

Firefox

Plugins/Add-ons/Extensions

    • FireFTP
    • Cookies Manager  (Also possibly Fire Cookie and View Cookies)
    • Show Password (click to show obfuscated passwords) 
    • Fireshot (screen capture, annotate, etc.)
    • XSS Me
    • New Tab Home Page (loads home page on new tab)
    • Awesome Screenshot
    • McAfee Secure URL Shortener
    • IE Tab 2 / IE View 
    • User Agent Switcher
    • Firebug
    • Calomel SSL Validation (a bit inconsistent) 
    • Hackbar
    • (Turn on Add-on Bar)
    • FirefoxSearchPlugins

Remove the AVG search from the address bar

Type about:config into address bar

Click I'll be careful

Type keyword.URL into the Filter box

Right click on that line and click Modify

Delete contents and type in   http://www.google.com/search?ie=UTF-8&oe=utf-8&q=

 

 

 

 

Google Chart

 

 

 
 

Blogspot

 

 

Domain Transfers

Transfer from web.com (and Network Solutions) to GoDaddy

Wait at least 60 days from renewal (9/12/2011, for 2 years)

Call Web.com to request that the domain name be unlocked, get an EPP key, auth key

    Try to call Tim B. in Executive Response Team - 8:00am-5:00pm EST - 1-800-556-4390   ert@web.com

    If not, work your way through regular support/billing - 800-338-1771     800-932-7584

 

 

Comments (0)

You don't have permission to comment on this page.