GithubHelp home page GithubHelp logo

jekyll-rawiron.github.io's People

Contributors

rawiron avatar

Watchers

 avatar  avatar

jekyll-rawiron.github.io's Issues

intellij tool windows

The User Interface: Tool Windows

A look at the User Interface shows you windows, menus and bars.

  • tool windows
  • editor windows
  • editor tabs
  • main menu
  • pop-up menu
  • context menu
  • status bar
  • navigation bar
  • tool bar

open switcher

ctrl+tab

Let's take a closer look a the tool windows.

Open

  • tool window alt+
  • re-open all previously active tool windows ctrl+shift+f12

Close

  • current tool window shift+esc, ctrl+f4
  • all tool windows ctrl+shift+f12

Expand, Rearrange

  • expand tool window ctrl+shift+”
  • resize tool window ctrl+shift+cursor

Jump To

  • tool window alt+
  • editor windows esc

shortcuts for tool windows

project view

  • expand all in view
  • collapse all in view

there is ctrl++ to expand and collapse blocks in the editor windows.

security setup

email

passwords

many accounts to manage.
for security it is required to

  • have strong passwords
  • no password duplication
  • renew passwords

put passwords in a vault like LastPass.
configure a two-factor authentication for the vault.
ideally use YubiKey.

Linux Sandboxing

Virtual Machine

Xen Hypervisor

linux security modules, LSM

AppArmor places applications in a sandbox defined by a policy.

enable AppArmor and check its status with

sudo apparmor_status

Kernel

kernel parameters

Reduce Attack Surface of the kernel

grsecurity

hardened kernels, distributions focusing on security

intellij code

navigate

show call hierarchy
show class hierarchy
show symbol usage

jump to definition of symbol

navigate history

  • go to previous position in code
  • go to next position in code

within in a module (file)

  • jump to next method of class
ctrl+f12
alt+<cursor up>
alt+<cursor down>
  • jump to next class
  • jump to next usage

mark and extract code

  • blocks
  • function
  • parameters
  • variable

move code

ctrl-shift-<cursor up>
ctrl-sift-<cursor down>

docker 101

install

sudo apt-get install docker.io

sudo service docker start
sudo groupadd docker
sudo usermod -aG docker achtmhz
newgrp - docker

docker run hello-world

docker cli

docker search ubuntu
docker pull ubuntu
docker images

docker run -i -t ubuntu bash
docker ps -a

docker ps -a --format "{{.ID}}: {{.Image}}: {{.Size}}"
docker ps -a --format "table {{.ID}}\t{{.Image}}\t{{.Size}}"

build and run

docker build -t 'rawiron/nginx' -f dockerfile-nginx .
docker run -d -p 8080:80 'rawiron/nginx' nginx -g 'daemon off;'

docker logs d522ba426d35
docker stop $(docker ps -q)

remove

docker rm $(docker ps -a -q)
docker rmi $(docker images -q)

docker rm $(docker ps -a -q --filter status=exited)
docker rmi $(docker images -q --filter dangling=true)

network

http://blog.sequenceiq.com/blog/2014/08/12/docker-networking/
https://docs.docker.com/engine/userguide/networking/

docker network ls
docker network inspect bridge

volumes

https://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/

Dockerfile

forward logs of the executable to docker log collector

ln -sf /dev/stdout /var/log/nginx/access.log \
  && ln -sf /dev/stderr /var/log/nginx/error.log

clean the cached apt files

rm -rf /var/lib/apt/lists/*

tools

Workflow S3 drive with encrypted data

Create an encrypted filesystem locally.
Sync data between decrypted and encrypted filesystem.
Push and Pull encrypted data to and from S3 using rclon

intellij edit

Edit

  • Edit commands use file semantics and not programming language semantics.
  • For example they work on lines, paragraphs, strings.
  • Most important is full text search.

find

scope of find

  • in whole project
  • in file

replace

edit history

go back to previous edit (back movement on edit history)

ctrl+shift+backspace

go to next edit (forward movement on edit history)

vimeo plugin stopped working

Content Security Policy: Directive ‘frame-src’ has been deprecated. Please use directive ‘child-src’ instead.  (unknown)
uncaught exception: undefined  (unknown)

performance numbers cheat sheet

"When you can measure what you are speaking about, and express it in numbers, you know something about it.", Lord Kelvin

Latency numbers every programmer should know

Hardware

storage

hard disk, 7.5K rpm, random IO: ops/sec
hard disk, 15K rpm, random IO: ops/sec
hard disk, 15K, 1TB, sequential scan: Mbit/sec
hard disk, 15K, random IO: response time

network

network, WAN, message US east to west cost: RTT
network, LAN, tcp, 1Gbit, message server to server within rack: RTT

PCIe

motherboard

memory, cpu cache
memory, DDR3,
data bus, response time: RTT
data bus, throughput: Mbit/s

storage hierarchy, relation cpu to memory to hard disk access time: 1 : 1,000 : 10,000

Hardware Cost

cpu, 4 cores:
cpu, 128 cores:
memory, 1TB: $
hard disk, 15K, 1TB
SSD, 1TB

OS

linux, context switch, process: total cpu cycles or cpu instructions

Units

Mbit
MB
Kbit
KB

2^8 = 256
2^7 = 128
2^32 =
2^64 =

Laws

Amdahls Law
Universal Scalability Law
Latency vs. Throughput: Is it true that increase in throughput increases latency (worse response time)?

intellij editor windows

Editor Windows

Create

  • editor window from new file alt+f+, alt+1++popup

Open

  • editor window from existing file ctrl+shift+n, ctrl+e

Close

  • current editor window ctrl+f4
  • all editor windows alt+w+

Jump To

  • editor window ctrl+tab, alt+cursor, esc, shift+esc, ctrl+shift+f12

git commands

  • learn the commands to master git workflow
  • understand how commands alter the version graph
  • see what commands do to your .git folder

method

  • split screen
  • show what happens in the .git directory with watch -n 1 -d tree .git
  • show what happens to the version graph with git log --oneline --all --decorate --graph

commands

  • work locally
  • communicate your changes with clean commits
  • make your commits readable

do not put the name of the branch in the commit message.
with a "merge" workflow the branch name is kept in the merge message.

git init
git checkout
git status
git add
git commit
git add -p

git reset -p
git reset --hard
git rebase -i

git checkout -b <branch_name>
git push origin --delete <branch_name>
git branch -d <branch_name>
git remote prune origin
  • view the version graph
  • check branches and merge commits
git log --oneline --all --decorate --graph
  • get a code review
  • merge your changes to master
git merge
git rebase
git merge --no-ff
git branch -d
  • go public and share your work
git init --raw
git push
git pull
  • see the difference
git diff HEAD
git diff --stage
git diff
git difftool

python - regex

write a quick tutorial on python regex
use Jupyter Notebook.

link to Notebook or include html version of Notebook in Jekyll.

apt-get and dpkg 101

usage

The name of the package is known.

  • Install, remove, update the package X

Which package contains the file L?
Is the package X installed?
What is in the package X?
Which files have been installed and where?
What is the version of the currently installed package?
When was the package X installed?

apt-get commands

add-apt-repository

apt-get install
apt-get update
apt-get upgrade
apt-get remove, apt-get purge
apt-get info

apt-cache

It works exclusively on the data acquired into the local package cache.

  • apt-cache search regex pattern
apt-cache search '\wfish\w'    

beneath-a-steel-sky - classic 2D point and click science fiction adventure game
bubblefishymon - system load dockapp with a duck
gkrellm-bfm - system load plugin for gkrellm with a duck
libfishsound1 - simple API that wraps Xiph.Org audio codecs
libfishsound1-dbg - simple API that wraps Xiph.Org audio codecs (debugging information)
libfishsound1-dev - simple API that wraps Xiph.Org audio codecs (development files)
libtwofish0 - Niels Ferguson's Twofish cryptographic library -- runtime package
xfishtank - turns your X root into an aquarium
  • apt-cache policy
apt-cache policy python           

python:
  Installed: 2.7.11-1
  Candidate: 2.7.11-1
  Version table:
 *** 2.7.11-1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status
  • apt-cache show

    show the meta information of the package (package record)

apt

  • apt search
  • apt list --installed

dpkg

dpkg --get-selections
dpkg --list
dpkg search

dpkg-query -W 'linux-image*'
dpkg-query -l 'linux-image*'

dpkg -i ./vagrant_2.2.3_x86_64.deb

list all the files a package installed onto the system

dpkg-query -L <package_name>

intellij - refactor

order methods of class

public on top
private at the bottom

copy a method

copy the types and parameters
copy the method's signature

move parts of a method into a new method

extract to method
ctrl-alt-m

inline method

symmetric to extract method
ctrl-alt-n

refactor factory method to dependency injection

current code uses static final factory methods
refactor to dependency injection

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.