-
Notifications
You must be signed in to change notification settings - Fork 1
/
unix.rmd
97 lines (66 loc) · 1.59 KB
/
unix.rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
title: "unix cheatsheet"
author: Emil Rehnberg
bibliography: refs.bib
csl: shiki.csl
output:
pdf_document:
highlight: zenburn
html_document:
toc_float: TRUE
css: styles.css
---
```{r set-options, echo=FALSE, cache=FALSE}
options(width = 200)
```
```{r echo=FALSE, eval=FALSE}
require(rmarkdown); require(shiny)
rmdFilePath <- "unix.rmd"
allexamples <- FALSE
rmarkdown::render(rmdFilePath, output_format="html_document") # "all_document"
```
## 目的
cheatsheet for unix.
## scheduled jobs {.tabset .tabset-fade .tabset-pills}
### Overview
section for scheduled jobs, aka cron jobs
### cron format
5 / 6 digits indicating the timing of the job
TODO: explain this further
### edit jobs
```sh
crontab -e
```
## users and groups {.tabset .tabset-fade .tabset-pills}
### Overview
[how-to-add-users](https://help.ubuntu.com/community/AddUsersHowto)
### add user
```sh
sudo adduser <username>
```
### add user to group
```sh
sudo addgroup <groupname>
```
### add user to existing group
```sh
sudo adduser <username> <groupname>
```
### show group members
```sh
getent group <groupname>
```
## workflows {.tabset .tabset-fade .tabset-pills}
### public keys setup for ssh
use private / public rsa keys to make ssh-logins more convenient :D
```sh
ssh-keygen
ssh-add ~/.ssh/id_rsa_password
ssh-copy-id -i ~/.ssh/id_rsa_password wms@de-2204.d.ipeer.se
```
### file compression
in order to compress a folder into a zip file
```sh
zip pack.zip folder-with-files # just adds the folder!
zip -r pack.zip folder-with-files # add the r(ecursive) flag to zip the files inside the folder
```