Skip to content

Instantly share code, notes, and snippets.

@davzoku
Last active December 21, 2017 09:05
Show Gist options
  • Save davzoku/af3690a3e14bc64dc0c2f83a0b80947b to your computer and use it in GitHub Desktop.
Save davzoku/af3690a3e14bc64dc0c2f83a0b80947b to your computer and use it in GitHub Desktop.
πŸ±β€πŸ‘€ On my way to become a shortcut kage

Lock PC:

Win + L

Open File Explorer:

Win + E

//Display Properties:

Alt + Enter

Open Settings:

Win + I

Open programs based on the order on the taskbar / switch to that program:

Win + number

Create new instance of an app from taskbar:

Shift + Click app on taskbar / Shift + Win + Number

Snap window to left / right:

Win + left / right

Task View & Virtual Desktop

Open Task view: Win + Tab
Add Virtual Desktop: Win + Ctrl + D
Switch between: Win + Ctrl + Left/Right
Close Virtual Desktop: Win + Ctrl + F4

Switch input language and keyboard layout:

Win + Spacebar

Dev Tools:

Console:
Ctrl + Shift + J

Page Source:
Ctrl + U

Scroll through tabs:

//Move to left tab
Ctrl + Shift + Tab

//Move to right tab
Ctrl + Tab

Spotify

To pause:

Space

Play Next:

Ctrl + Right

Shuffle:

Ctrl + S

Repeat:

Ctrl + R

Linux

To start a bash script:

#!/bin/bash

chmod:

chmod 777 test.sh

Directory

// change directory
Up 1 level:
cd ..

Up 3 level:

cd ../../..

// make directory: create a new folder
mkdir foldername

// copy files
cp -i file.txt newfolder

// move files
mv -i file.txt newfolder

// remove file
rm filename
// ask for confirmation before delete (interactive)
rm -i filename

// remove directory
rm -r foldername

Change password:

passwd

To Compile

C:

gcc inputname.c -o outputname

C++:

g++ inputname.cpp -o outputname

To run:

./outputname

makefile:

make
build/a.out

Java

sudo apt-get install openjdk-7-jdk
javac filename.java
java filename

UDP mode; Listen Mode; IPv6; on port 59332

ncat -ul -6 59332

rsync + ssh script

#!/bin/bash

echo "start script"
rsync --chmod=u+rwx,g+rwx,o+rwx ./build/a.out 192.168.4.100:/tmp

ssh 192.168.4.100 "cd /tmp; ./a.out"

can-utils / CAN Commands

candump : display, filter and log CAN data to files canplayer : replay CAN logfiles cansend : send a single frame cangen : generate (random) CAN traffic cansniffer : display CAN data content differences (just 11bit CAN IDs)

To create vcan0:

sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0

create virtual can data to display, log, replay Generate random on vcan0

cangen vcan0 -v

To log from another terminal window:

candump -l vcan0
candump -L vcan0 > test1.log
log2asc -I test1.log vcan0

Send a particular CAN message to vcan0

cansend vcan0 01a#11223344AABBCCDD

cansniffer

cansniffer vcan0

GitHub

git status
git add .
git commit -m "message"
git push

Markdown Cheatsheet

Atom

Command Palette

Ctrl + Shift + P

Settings

Ctrl + ,

HTML

! + Tab = HTML5 Doctype

div.container = <div class="container"></div>

//div is default
//div with 3 classes
.one.two.three = <div class="one two three"</div>

img.one.two.three = <img src="" alt="" class="one two three">

From command palette:

gist:list
//find gist
tab
select "edit"

php

To run php on localhost in Ubuntu:

php -S localhost:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment