Skip to content

Instantly share code, notes, and snippets.

View supervoron1's full-sized avatar
🏠
Working from home

Dmitriy Vorontsov supervoron1

🏠
Working from home
View GitHub Profile
dmitry@linuxmint in ~
$ sqlite3 test_guru
sqlite> CREATE TABLE categories (
...> id INT PRIMARY KEY,
...> title VARCHAR(40)
...> );
sqlite> CREATE TABLE tests (
...> id INT PRIMARY KEY,
...> title VARCHAR(40),
@supervoron1
supervoron1 / SQL Join as many as you like
Created February 11, 2020 18:22
SQL Join as many as you like
Select <column list>
From T1
Join T2 on T1.key = T2.key
Join T3 in T2.key = T3.key
---------------------------------
CREATE TABLE `authors` (
`id` int(11) NOT NULL,
`title` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
@supervoron1
supervoron1 / GitCommitEmoji.md
Created November 11, 2019 08:43 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
section, header, footer {
padding: 0 15px;
}
@media (min-width: 575.98px){
section, header, footer {
padding: 0 calc(50vw - 270px);
}
}
cat /etc/passwd - decscribes all users
cat /etc/group - info about groups
cat /etc/shadow - хранятся хэши паролей
id - инфа о текущем пользователе
type - показывает инфу о команде (alias, path)
which - показывает где
Права может менять только владелец файла, либо root:
chmod u-rw,g+x,o+rw file.txt - права для user,group,others
chmod a-rwx file.txt - убрать rwx для all
chmod 761 file.txt - права=> rwx|rw-|--x для file.txt (4 - read, 2 - write, 1 - execute)
---------AMEND CASE
git log --oneline
d142679 second commit
86f1495 first commit
git add main.c --- внесли изменения в файл и решили закомитить ВМЕСТО second commit(последнего)
> git commit --amend -m "third commit"
> git log --oneline
18411fd third commit
86f1495 first commit
В резульатате из репозитория пропал коммит с id=d142679, вместо него теперь коммит с id=18411fd.
# Шпаргалка по консольным командам Git
## Общее
Git — система контроля версий (файлов). Что-то вроде возможности сохраняться в компьютерных играх (в Git эквивалент игрового сохранения — коммит).
Любой файл в папке существующего репозитория может находиться или не находиться под версионным контролем (отслеживаемые и неотслеживаемые).
Неотслеживаемые файлы можно в любой момент сделать отслеживаемыми и наоборот.
----- Installing Ruby ------
http://rvm.io/
\curl -sSL https://get.rvm.io | bash -s stable --rails
rvm list known
rvm list
rvm use 2.6.3 --default (если это не работает то перед этим выполнить см ниже...)
/bin/bash --login
source ~/.rvm/scripts/rvm
либо просто добавить в .bash_profile:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
@supervoron1
supervoron1 / gist:59169341fb749cf6c57ed6e3495b0469
Created September 3, 2019 05:56
GET and POST methods with/without parameters
dmitry@linuxmint in ~
$ ncat -C httpbin.org 80
GET / HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: text/html; charset=utf-8
Date: Tue, 03 Sep 2019 05:11:04 GMT