April 30th and Snow is Falling

Author: , Posted on Monday, April 30th, 2018 at 8:00:23am

snow-20180430-001

How To Locate Attached Disk Devices in Linux

Author: , Posted on Tuesday, April 24th, 2018 at 11:11:40am

https://linux.die.net/man/8/lsblk
# lsblk -a

1
2
3
4
5
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme1n1       259:0    0  100G  0 disk /volumes/data
nvme0n1       259:1    0   20G  0 disk 
├─nvme0n1p1   259:2    0   20G  0 part /
└─nvme0n1p128 259:3    0    1M  0 part 
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme1n1       259:0    0  100G  0 disk /volumes/data
nvme0n1       259:1    0   20G  0 disk 
├─nvme0n1p1   259:2    0   20G  0 part /
└─nvme0n1p128 259:3    0    1M  0 part 

April 19th and Snow is Falling

Author: , Posted on Thursday, April 19th, 2018 at 8:49:11am

images-of-snow-8

April 17th and Snow is Falling

Author: , Posted on Tuesday, April 17th, 2018 at 8:08:03am

images-of-snow-8

How To Move in vim Using the Keyboard

Author: , Posted on Wednesday, March 21st, 2018 at 12:55:29pm

h move one character left
j move one row down
k move one row up
l move one character right
w move to beginning of next word
b move to previous beginning of word
e move to end of word
W move to beginning of next word after a whitespace
B move to beginning of previous word before a whitespace
E move to end of word before a whitespace
All the above movements can be preceded by a count; e.g. 4j moves down 4 lines.

0 move to beginning of line
$ move to end of line
_ move to first non-blank character of the line
g_ move to last non-blank character of the line

gg move to first line
G move to last line
ngg move to n'th line of file (n is a number; 12gg moves to line 12)
nG move to n'th line of file (n is a number; 12G moves to line 12)
H move to top of screen
M move to middle of screen
L move to bottom of screen

zz scroll the line with the cursor to the center of the screen
zt scroll the line with the cursor to the top
zb scroll the line with the cursor to the bottom

Ctrl-D move half-page down
Ctrl-U move half-page up
Ctrl-B page up
Ctrl-F page down
Ctrl-O jump to last (older) cursor position
Ctrl-I jump to next cursor position (after Ctrl-O)
Ctrl-Y move view pane up
Ctrl-E move view pane down

n next matching search pattern
N previous matching search pattern
* next whole word under cursor
# previous whole word under cursor
g* next matching search (not whole word) pattern under cursor
g# previous matching search (not whole word) pattern under cursor
gd go to definition/first occurrence of the word under cursor
% jump to matching bracket { } [ ] ( )

fX to next 'X' after cursor, in the same line (X is any character)
FX to previous 'X' before cursor (f and F put the cursor on X)
tX til next 'X' (similar to above, but cursor is before X)
TX til previous 'X'
; repeat above, in same direction
, repeat above, in reverse direction

How To Scroll to the Top of the Page using Javascript

Author: , Posted on Tuesday, March 20th, 2018 at 3:30:54pm

window.scrollTo(x-coord, y-coord);

Example: window.scrollTo(0,0);

R.I.P. Stephen Hawking

Author: , Posted on Wednesday, March 14th, 2018 at 8:33:23am
R.I.P. Stephen Hawking 1942-2018, a renowned physicist and ambassador of science.

R.I.P. Stephen Hawking 1942-2018, a renowned physicist and ambassador of science.

How To Expand a Filesystem on AWS Linux

Author: , Posted on Tuesday, March 6th, 2018 at 6:50:19am

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

This only works on the new expandable volumes. YMMV, as always.

1. Examine
file -s /dev/xvd*
lsblk
df -h

2. Grow partition
Expand the modified partition using growpart (and note the unusual syntax of separating the device name from the partition number):
growpart /dev/xvda 1
lsblk

3. Expand filesystem
resize2fs /dev/xvda1
df -h

How To Strip Windows Newlines in PHP

Author: , Posted on Wednesday, February 21st, 2018 at 12:20:45pm

$text = str_replace("\r", "", $text);

Dogs are Evil

Author: , Posted on Monday, February 12th, 2018 at 9:24:54am

mc-new-jersey-vicious-dog-law-20150604We need dog leash laws and owner accountability.

Dog bites are a problem. According to the American Veterinary Medical Association, 4.5 million Americans are bitten by dogs each year, and every day, nearly 1,000 individuals show up in hospital emergency rooms because of dog attacks. The annual cost of medical treatments for dog bites (including 27,000 reconstructive surgeries) is over $250,000,000, and insurance companies fork out $530 million dollars a year in dog bite claims. Then there are the 26 Americans who were killed by dogs last year.

Here’s what the researchers found:
• 25 percent of the participants had been bitten by a dog.
• Only one in three victims received medical attention.
• Men were nearly twice as likely to have been bitten as women.
• People who owned multiple dogs were three times more likely to be bitten than non-dog owners.
• Children are at higher risk: 44 percent of the bites occurred when the victim was younger than 16.
• In 55 percent of cases, the person had never before seen the dog that bit them.
• But the most interesting finding was related to personality: People with higher scores on the Big Five trait of emotional stability were 22% less likely to have been bitten by a dog than were individuals who were less emotionally stable.

https://www.psychologytoday.com/blog/animals-and-us/201802/personality-affects-your-chances-being-attacked-dog