Search This Blog

Showing posts with label cheat sheet. Show all posts
Showing posts with label cheat sheet. Show all posts

Sunday, January 4, 2015

mysql cheat sheet

How to grant access any user from one network only to mysql

 
$ mysql -p
(root@localhost@localhost) 03:49:13 [mysql]> grant all on *.* to ''@'192.168.10.%';
$service mysql reload  


Please note the empty user name in the syntax above.
For this changes to be effective I needed to reload the mysql.


Surprisingly these 2 commands don't work at all as much as you would believe. The '*' or the '%' for the user column have no wildcard meaning.
 
(root@localhost@localhost) 03:49:13 [mysql]> grant all on *.* to '%'@'192.168.10.%';
(root@localhost@localhost) 03:49:13 [mysql]> grant all on *.* to '*'@'192.168.10.%';

This is how you can check the current grants (you need to flush the privileges or reload the mysql config as changes issues with 'grant' don't take actions immediately).
 
(root@localhost@localhost) 03:51:30 [mysql]> select * from user;
+---------------------+------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+----------
| Host                | User | Password                                  | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | Reference
+---------------------+------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+----------
| localhost           | root | *2447D497B9A6A15F2776055CB2D1E9F86758182F | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y
| OL63x64.example.com | root | *DCAB8B850144B862687D44957E317DE424E12923 | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y
| 127.0.0.1           | root | *DCAB8B850144B862687D44957E317DE424E12923 | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y
| ::1                 | root | *DCAB8B850144B862687D44957E317DE424E12923 | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y
| 192.168.10.%        |      | *2447D497B9A6A15F2776055CB2D1E9F86758182F | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | N          | Y
+---------------------+------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+----------
5 rows in set (0.00 sec)

or

[root@OL63x64 log]# pt-show-grants --password=rrr
-- Grants dumped by pt-show-grants
-- Dumped from server Localhost via UNIX socket, MySQL 5.6.12-enterprise-commercial-advanced at 2015-01-04 15:55:27
-- Grants for ''@'192.168.10.%'
GRANT ALL PRIVILEGES ON *.* TO ''@'192.168.10.%' IDENTIFIED BY PASSWORD '*2447D497B9A6A15F2776055CB2D1E9F86758182F';
-- Grants for 'root'@'127.0.0.1'
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY PASSWORD '*DCAB8B850144B862687D44957E317DE424E12923' WITH GRANT OPTION;
-- Grants for 'root'@'::1'
GRANT ALL PRIVILEGES ON *.* TO 'root'@'::1' IDENTIFIED BY PASSWORD '*DCAB8B850144B862687D44957E317DE424E12923' WITH GRANT OPTION;
-- Grants for 'root'@'OL63x64.example.com'
GRANT ALL PRIVILEGES ON *.* TO 'root'@'ol63x64.example.com' IDENTIFIED BY PASSWORD '*DCAB8B850144B862687D44957E317DE424E12923' WITH GRANT OPTION;
-- Grants for 'root'@'localhost'
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*2447D497B9A6A15F2776055CB2D1E9F86758182F' WITH GRANT OPTION;
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION;

References
http://dev.mysql.com/doc/refman/5.6/en/default-privileges.html

Show mysqld server and mysql client options

server options compiled-in defaults and any option files that it reads:
mysqld --verbose --help

server options (ignoring the settings in any option files):
mysqld --no-defaults --verbose --help

runtime/running server options     : mysqladmin variables

parsed options from config file(s): mysqld --print-defaults
 mysqld would have been started with the following arguments:
--datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --user=mysql --symbolic-links=0

Saturday, May 17, 2014

Linux Bash cheat sheet

I've spend some time googling for bash shortcats using phrases like: bash readline shortcat, copy and paste text to bash clipboard, etc  ... I always forget how to do this, especially when I don't work on Linux for a while.

Below is a list of my favorite (hard to remember) bash shortcats and tricks I like to use.

Bash shortcats

Ctrl + w  Cut the Word before the cursor to the clipboard
Ctrl + y  Paste the last thing to be cut (yank)
Alt + r  Cancel the changes and put back the line as it was in the history (revert).

Bash tricks to speed up typing 
  • How to copy the last command 
  • How to copy and paste the last command output
This one is my favorite because it allows me to refer to a previous command output text without having to copy and paste it with mouse.

# readline function
shell-expand-line (M-C-e)

Example 1:
$ myvar="/etc/passwd"
$ echo $myvar
$ ls $(echo $myvar)

Before you press enter press now (M-C-e) and the line will turn into

ls /etc/passwd-rrr

Example 2:
$ ls -l /etc/passwd
$ echo !!

Before you press enter press now (M-C-e) and the line will turn into

echo ls -l /etc/passwd

Example 3:

$ ls -l /etc/passwd
$ echo $(!!)

Before you press enter press now (M-C-e) and the line will turn into

echo -rw-r--r-- 1 root root 1399 May 17 02:19 /etc/passwd

References

http://ss64.com/bash/syntax-keyboard.html
http://superuser.com/questions/304519/how-to-copy-the-results-from-a-grep-command-to-the-bash-clipboard
http://superuser.com/questions/421463/why-does-ctrl-v-notpaste-in-bash-linux-shell
http://unix.stackexchange.com/questions/15850/how-to-use-keyboard-instead-of-mouse-middle-click-for-copy-paste
http://stackoverflow.com/questions/749544/pipe-to-from-clipboard
https://wiki.archlinux.org/index.php/Keyboard_Shortcuts
http://rtomaszewski.blogspot.co.uk/2013/06/linux-and-bash-cheat-sheet.html



Sunday, January 5, 2014

How to divide and split file a part based on regex

We have a following file.
 
# cat text-to-split.txt
       1  aaa
       2  b1
       3  bb2
       4  bbb3
       5  c
       6  c1
       7  cc2
       8  aaa
       9  b1
      10  bb2
      11  c
      12  c1
      13  cc2
      14  aaa
      15  b1
      16  c
      17  cc2
      18  aaa
      19  b1
      20  aaa
      21  c1
      22  ccc

Problem

How to split and divide file based on its content?

Analisis and results description

Example 1 : Single split line in whole file

The file will be divided on each line matching a single patter.
 
# csplit -k text-to-split.txt '%aaa%' '/aaa/' '{*}'
74
62
41
22
35
root@perf1:~/split# for i in xx0*; do echo $i; cat -n $i; done
xx00
     1       1  aaa
     2       2  b1
     3       3  bb2
     4       4  bbb3
     5       5  c
     6       6  c1
     7       7  cc2
xx01
     1       8  aaa
     2       9  b1
     3      10  bb2
     4      11  c
     5      12  c1
     6      13  cc2
xx02
     1      14  aaa
     2      15  b1
     3      16  c
     4      17  cc2
xx03
     1      18  aaa
     2      19  b1
xx04
     1      20  aaa
     2      21  c1
     3      22  ccc

Example 2 : multiple split line

The csplit takes a variable number of regular expressions.
It scans the file and once a line matches the regex it splits the file at this point.
It evaluates then the next regular expression and continue to scan remaining file data.
When a match is found the file is split at this point again.
The last regex is used to split the remaining file until we read EOF.

In this example we:
  • Jump to line containing b1 (don't copy and save the data - %)
  • Continue searching for aaa and split when found.
  • Continue searching for c1 and split when found.
  • Use the last regex (c1) if file still have data.
csplit -k text-to-split.txt '%b1%' '/aaa/' '/c1/' '{*}'
63
41
96
23
root@perf1:~/split# for i in xx0*; do echo $i; cat -n $i; done
xx00
     1       2  b1
     2       3  bb2
     3       4  bbb3
     4       5  c
     5       6  c1
     6       7  cc2
xx01
     1       8  aaa
     2       9  b1
     3      10  bb2
     4      11  c
xx02
     1      12  c1
     2      13  cc2
     3      14  aaa
     4      15  b1
     5      16  c
     6      17  cc2
     7      18  aaa
     8      19  b1
     9      20  aaa
xx03
     1      21  c1
     2      22  ccc

References

http://rtomaszewski.blogspot.co.uk/2013/05/openssl-cheat-sheet.html

Saturday, January 4, 2014

Thursday, November 21, 2013

Evernote cheat sheet

This is a work in progress ... my shortcats I relay on and best practices for Evernote.
  • From the Windows desktop
CTRL-Alt-N: create a new note

  • From the Evernote window
Shift-Alt-N: Jump to Notebooks
Shift-Alt-T: Jump to Tags and start searching based on the labels

Tuesday, October 29, 2013

Python cheat sheet

Programming
  • How to pretty print JSON record
echo '{"name":"value"}' | python -mjson.tool


Sunday, September 1, 2013

Cisco cheat sheet

This is work in progress...

ASA
  • How to drop or terminate existing connections on the firewall 
Even if you add an ACL to prevent unnecessary traffic it applies only to a new incoming connections. To clear already existing connection you can use one of these:

clear local-host ?
clear conn ?
clear xlate ?

References: link1link2
  • Performance troubleshooting commands
console logs
show blocks
show blocks queue history detail
show clock
show conn count
show controller
show counters
show cpu hogging process
show cpu usage
show crashinfo
show crashinfo module 1
show disk0: controller
show failover
show failover history
show firewall
show history
show interface
show kernel process
show memory
show memory detail
show mode
show module
show perfmon
show process
show running-config
show service-policy
show startup-config errors
show traffic
show xlate count


Switches
  • On a Cisco switch how to find physical port mapping to ASIC chipsets 
switch#show platform port-asic version

Port-Asic Version Info:
========================
ASIC-0: Version:1 DeviceType:0x2CA
ASIC-1: Version:1 DeviceType:0x2CA
ASIC-2: Version:1 DeviceType:0x2CA
ASIC-3: Version:1 DeviceType:0x2CA
ASIC-4: Version:1 DeviceType:0x2CA
ASIC-5: Version:1 DeviceType:0x2CA
ASIC-6: Version:1 DeviceType:0x2CA
ASIC-7: Version:1 DeviceType:0x2CA
ASIC-8: Version:1 DeviceType:0x2CA
ASIC-9: Version:1 DeviceType:0x2CA
ASIC-10: Version:1 DeviceType:0x2CA
ASIC-11: Version:1 DeviceType:0x2CA

switch# sh platform pm if-numbers

interface gid  gpn  lpn  port slot unit slun port-type lpn-idb gpn-idb
----------------------------------------------------------------------
Gi0/1     1    1    1    5/3  1    1    1    local     Yes     Yes
Gi0/2     2    2    2    5/0  1    2    2    local     Yes     Yes
Gi0/3     3    3    3    5/1  1    3    3    local     Yes     Yes
Gi0/4     4    4    4    5/2  1    4    4    local     Yes     Yes
Gi0/5     5    5    5    4/2  1    5    5    local     Yes     Yes
Gi0/6     6    6    6    4/3  1    6    6    local     Yes     Yes
Gi0/7     7    7    7    4/0  1    7    7    local     Yes     Yes
Gi0/8     8    8    8    4/1  1    8    8    local     Yes     Yes
....

References: link1

switch# sh interfaces GigabitEthernet0/35

switch# sh interfaces counters errors
Port        Align-Err     FCS-Err    Xmit-Err     Rcv-Err  UnderSize  OutDiscards
Gi0/1               0           0           0           0          0            0
...
Gi0/33              0           0           0           0          0         2904
Gi0/34              0           0           0           0          0     10007689
Gi0/35              0           0           0           0          0      3826473
Gi0/36              0           0           0           0          0            0


switch# sh controllers ethernet-controller gigabitethernet 0/35
 
     Transmit FastEthernet0/20                Receive
   3538920087 Bytes                       2280518202 Bytes
    305038868 Unicast frames              3307737521 Unicast frames
    142899941 Multicast frames                     0 Multicast frames
     19633020 Broadcast frames                  4000 Broadcast frames
            0 Too old frames              2280260439 Unicast bytes
            0 Deferred frames                      0 Multicast bytes
            0 MTU exceeded frames             256000 Broadcast bytes
            0 1 collision frames                   0 Alignment errors
            0 2 collision frames                   2 FCS errors
            0 3 collision frames                   0 Oversize frames
            0 4 collision frames                   0 Undersize frames
            0 5 collision frames                   0 Collision fragments
            0 6 collision frames
            0 7 collision frames           657619578 Minimum size frames
            0 8 collision frames          1231476052 65 to 127 byte frames
            0 9 collision frames           316726340 128 to 255 byte frames
            0 10 collision frames          333559372 256 to 511 byte frames
            0 11 collision frames          204171553 512 to 1023 byte frames
            0 12 collision frames          564188628 1024 to 1518 byte frames
            0 13 collision frames                  0 Overrun frames
            0 14 collision frames                  0 Pause frames
            0 15 collision frames
            0 Excessive collisions                 0 Symbol error frames
            0 Late collisions                      0 Invalid frames, too large
            0 VLAN discard frames                  0 Valid frames, too large
            0 Excess defer frames                  0 Invalid frames, too small
   1771916610 64 byte frames                       0 Valid frames, too small
   2039491270 127 byte frames
    101128332 255 byte frames                      0 Too old frames
    498899274 511 byte frames                      0 Valid oversize frames
    158317216 1023 byte frames                     0 System FCS error frames
    192786423 1518 byte frames                     0 RxPortFifoFull drop frame
            0 Too large frames
            0 Good (1 coll) frames
            0 Good (>1 coll) frames

switch# sh controllers ethernet-controller port-asic statistics 

switch# sh controllers utilization
switch# sh controllers gigabitEthernet 0/35 utilization
Receive Bandwidth Percentage Utilization   : 14
Transmit Bandwidth Percentage Utilization  : 18

switch# sh platform port-asic stats drop

References: Switch Command Referencelink2link3Troubleshooting Switch Port

Routers

TBD

Wednesday, June 19, 2013

F5 Network BigIp cheat sheet

This post is a work in progress...
  • How to generate a list with one self ip and vlans per line 
# tmsh list /net self  | egrep 'self|vlan' | xargs -n 6 echo
net self 10.2.2.2/30 { vlan FAILOVER
net self 10.176.30.100/19 { vlan hybridServiceNet-140
net self 10.176.30.102/19 { vlan hybridServiceNet-140
net self 10.176.94.132/19 { vlan hybridServiceNet-142

Or 


# tmsh list net self | egrep -v 'floating|unit|allow-service' | xargs -n 7
net self 10.178.191.49/18 { vlan rackconnect110 }
net self 10.179.63.181/18 { vlan rackconnect112 }


  • How to simulate F5 health check requests with empty Host header
  • How to parse tmsh output
http://rtomaszewski.blogspot.co.uk/2013/07/ways-to-parse-tmsh-output-and-automate.html

Monday, June 17, 2013

Openstack or Linux or bash cheat sheet

This post is a work in progress.
  • How to generate a list of commands base on input list. 
Per one input line one output command
# echo a b c | xargs -n 1 echo 'this is ' 
this is  a
this is  b
this is  c

Practical demo of how to delete all your cloud servers
# nova --no-cache list | grep '[|]' | awk '{print $2}' | tail -n +2 | xargs -n1 echo nova delete
nova delete 0dafascd-e7e5-4531-9542-25132338a3fc
nova delete ffasff56-ef5a-42e8-aa96-594d14538def
nova delete ad509afa-0cc8-111b-a681-7c56cc354957
nova delete b9bfafaf-073d-4732-a9c0-2e6720938357
  • Testing if you can establish a TCP session
$ nc -v -p 1185 92.52.111.222 80
Connection to 92.52.111.222 80 port [tcp/http] succeeded!
  • some of the useful CLIs
fold - Filter for folding lines. This breaks the lines to have a maximum of x width column position (or bytes).
column - columnate lists

  • How to check TCP / UDP network and socket statistics 
export file=/tmp/netstat.txt
netstat  -nntulpa &> $file

cat $file | grep tcp | awk ' { print $6 } ' | sort | uniq
cat $file 2 | grep udp

cat $file | grep tcp | awk ' { print $6 } ' | sort | uniq
CLOSE_WAIT
CLOSING
ESTABLISHED
FIN_WAIT1
FIN_WAIT2
LAST_ACK
LISTEN
SYN_RECV
SYN_SENT
TIME_WAIT

cat $file | grep tcp | awk ' { print $6 } ' | sort | uniq | while read STATE; do echo $STATE; grep $STATE $file | wc -l; done
CLOSE_WAIT
2
CLOSING
8
ESTABLISHED
53
FIN_WAIT1
15
FIN_WAIT2
0
LAST_ACK
136
LISTEN
20
SYN_RECV
166
SYN_SENT
0
TIME_WAIT
2

Other useful links: link1link2link3
  • How to sort files based on file size 
$ find . -mount -type f -ls|sort -rnk7 |head -30|awk '{printf "%10d MB\t%s\n",($7/1024)/1024,$NF}'

        52 MB   ./lib/libwireshark.so.2.0.2
        17 MB   ./lib/x86_64-linux-gnu/libicudata.so.48.1.1

  • How to cat and highlight a word in text
$ cat file | egrep --color=always "pattern|$"
$echo -n 'ello' | ( read a; read -u1 b ; echo "1st read : - $a -"; echo "2th read : = $b =" )
test
1st read : - ello -
2th read : = test =
  • How to truncated and shrink the text output to your terminal screen width
$ tcpdump -l -s0 -nn -i 0.0 'host 192.168.99.126 and port 443 and ( tcp[13]=2 )' | cut -c -$(tput cols)

  • How to print a file without the first line

  • $ cat tmp1
    a1
    a2
    a3
    a4
    

    Remove the fist line
    $ cat tmp1 | tail -n+2
    a2
    a3
    a4
    

    Remove the line #2 and #3
    cat tmp1 | sed '2,3d'
    a1
    a4
    

    Remove the first 2 lines
    $ cat tmp1 | tail -n+3
    a3
    a4
    

  • How to extract IP address from tcpdump output

  • $ tcpdump -nr attack.log
    21:35:49.553423 IP 162.13.0.27.22 > 82.44.149.5.51227: Flags [P.], seq 567291273:567291325, ack 2916928547, win 312, length 52
    21:35:49.573227 IP 82.44.149.5.51227 > 162.13.0.27.22: Flags [.], ack 52, win 16516, length 0
    

    Extract source IP and port
    $ tcpdump -nr attack.log | tmp.xt |awk '{print $3}'
    162.13.0.27.22
    82.44.149.5.51227
    

    Strip of the port number
    $ tcpdump -nr attack.log | awk '{print $3}' | grep -oE '[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}'
    162.13.0.27
    82.44.149.5
    
  • How to count strings in a text using awk
$ cat  | awk '  { count+=NF } END { print count;}'
1 2 aaaa :rrr :ddjf -dd rrd ccc zz
1 2 3 4 444; -d df
16

Tuesday, June 11, 2013

Sublime keyboard shortcat list

This is work in progress...
  • Below is a list of most common keyboard shortcats I use in Sublime (this is a work in progress post)
Ctrl-Shift-Space - select whole string in brackets
Ctrl-B - show/hide results panel
Ctrl-D - highlight a word
Alt-F3 - multi selection for all highlighted words
F4 - (in the search results Ctrl+Shift+F) opens a file and takes you to highlighted line
Ctrl-F2 - marks a point in a line and create a point for multi selection if needed
Alt-F2 - edit all the marked lines at once (create a multi selection from all the marks above)
Alt-F2, Ctrl-F2 - removes all the marks in the file
Ctrl+Alt+Enter - In the Find/Replace window at the bottom it 'Replace All' matches
More keyboard shortcats https://gist.github.com/eteanga/1736542

Sublime has a built in console terminal with ctrl+` . When type sublime.log_commands(True) there you enable verbose logging. When enabled you are going to see all commands that Sublime is executes as you use it. Just remember to turn logging off when you’re done :)

More function to play with can be found here: http://www.sublimetext.com/docs/2/api_reference.html

Tuesday, May 21, 2013

Openssl cheat sheet

  • How to extract certificates
Usual certificate files have not only the certificate itself but include the chain as well.

# example chain cert file

-----BEGIN CERTIFICATE-----
687f687asfafaufyaufasfyfyasifyayfafvG74WlTANBgkqhkiG9w0BAQUFADBm
678fa6auyasfyasf8a7fa9f7a9sfiauy987safasffQgSW5jMRkwFwYDVQQLExB3
....
UW9iatnbVzOcOdJJaBK7obGALVFBAQ==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
76af5at7fat8f7astfuyasftuftauftaufasfasfOzANBgkqhkiG9w0BAQUFADBs
....
tfiuytaiutauisftiaustfiuasftuiastfasf2oWGU4K8K2Eyl2Us1p292E=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
tfuastfuiatfutfuiatfiuatsifuastifuayrkYldzANBgkqhkiG9w0BAQUFADBs
....
tuaftiautfuaftiuatfiuastfuastfiuastfiastfuatsifutafutafutasuftap
+OkuE6N36B9K
-----END CERTIFICATE-----

To extract each certificate and save it in a separate file you can use this little tick.
 
root@server:~# csplit -k cert.txt '%-----BEGIN CERTIFICATE-----%' '/-----END CERTIFICATE-----/+1' {9}
2362
2260
1367
csplit: `/-----END CERTIFICATE-----/+1': match not found on repetition 3
1

root@server:~# ll 
-rw-r--r-- 1 root root 2362 May 21 16:50 cert.txt
-rw-r--r-- 1 root root 2362 May 21 16:50 xx00
-rw-r--r-- 1 root root 2260 May 21 16:50 xx01
-rw-r--r-- 1 root root 1367 May 21 16:50 xx02
-rw-r--r-- 1 root root    1 May 21 16:50 xx03

# because it is irrelevant
root@server:~# rm xx03 
  • How to verify that the certificate and key belong together
$ openssl x509 -noout -modulus -in server.crt | openssl md5
$ openssl rsa -noout -modulus -in server.key | openssl md5
  • How to verify what certificate and what certificate chain does a https server sends
$ openssl s_client -connect :443 -showcerts

Without the -showcerts option the openssl shows only a site certificate (a top certificate in the chain), hiding the remaining certs received in server hello handshaking message. Please be aware that in the regular output you can still see there were intermediate certs although:.

Certificate chain
 0 s:/1.3.6.1.4.1.311.60.2.1.3=GB/2.5.4.15=Private Organization/serialNumber=04168207/C=GB/ST=Greater Manchester/L=Manchester/O=Party Delights Limited/OU=Web Development/CN=www.example.com
   i:/C=US/O=thawte, Inc./OU=Terms of use at https://www.thawte.com/cps (c)06/CN=thawte Extended Validation SSL CA

 1 s:/C=US/O=thawte, Inc./OU=Terms of use at https://www.thawte.com/cps (c)06/CN=thawte Extended Validation SSL CA
   i:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA

 2 s:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA
   i:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA

References
  1. https://kb.wisc.edu/middleware/page.php?id=4064


Thursday, May 9, 2013

Outlook keyboard shortcat list

I'm getting more than hundreds of messages a day. Some of them are generated automatically by automatic systems to monitor infrastructure. Others are normal working communication.

When you don't have time you quickly learn all sort of shortcats to deal with you daily tasks. This applies as well to managing your mail box in outlook. Below is a reference of some of my favourite outlook shortcat I relay on :)

Ctrl-Z   - Undelete a Message
Ctrl-Del - Delete and Mute a Conversation
Ctrl-ENTER - Mark a message as read
Ctrl-Q   - Mark a message as read
Ctrl-T   - Mark a thread as read
Ctrl-U   - mark as unread mail message
Ctrl-K   - Check names
Ctrl-N   - Open or post a new message
Ctrl-R   - Reply to message author
Ctrl-SHIFT-R - Reply to all
F3       - search
Ctrl-Shift-V - Move Email Messages Quickly in Outlook
Ctrl+Y    - Select a different folder
F6 - move the focus to next GUI element/window (you can use it to move the focus into the email to scroll it down)
Shift + F6 - move the focus backwards (with F6 and Shift+F6 you can quickly scroll through you email list and emails content using only  your keyboard)
Ctrl-UP arrow/Down arrow - in the Reading Pane, go to the previous or next message
SPACEBAR - in the Reading Pane, page down through text.
ALT+B, ALT+LEFT ARROW, or ALT+BACKSPACE - Go back to previous view in main Outlook window

References
  1. http://www.stevenchalmers.com/Tips/Outlook.shtml
  2. http://www.stevenchalmers.com/Tips/Outlook.shtmlhttp://email.about.com/od/outlooktips/qt/How-To-Undelete-A-Message-Quickly-In-Outlook.htm
  3. http://email.about.com/od/outlooktips/qt/How_to_Delete_and_Mute_a_Conversation_in_Outlook.htm
  4. http://email.about.com/cs/outlooktips/qt/et052701.htm
  5. http://office.microsoft.com/en-us/outlook-help/keyboard-shortcuts-for-outlook-HP001230396.aspx

Sunday, February 10, 2013

My git recipes

  1. To download the repository to your local host
  2. $ git clone https://github.com/rtomaszewski/#repo.git#
    

    Or you can upload a public SSH key to your github account as described here https://help.github.com/articles/generating-ssh-keys and then clone using SSH method.

    $ git clone git@github.com:rtomaszewski/#repo.git#
    

  3. To commit and upload the source back to repository
  4. $ cd #repo#
    $ git add new-file.py
    $ git commit new-file.py -m 'init'
    $ git push origin master

  5. To update your local repository with the master
  6. $ cd #repo#
    $ git pull
    $ git pull origin master

  7. List config settings
  8. $ cd #repo#
    $ git config -l 

  9. Rename a file
  10. $ cd #repo#
    $ git mv README README.md
    $ git commit -m "renamed"
    $ git push origin master
    
References
  1. http://stackoverflow.com/questions/5989893/github-how-to-checkout-my-own-repository
  2. http://superuser.com/questions/199507/how-do-i-ensure-git-doesnt-ask-me-for-my-github-username-and-password
  3. https://help.github.com/articles/set-up-git#password-caching