Skip to content

Instantly share code, notes, and snippets.

View vovs03's full-sized avatar

Vλadimir Pavλychev vovs03

View GitHub Profile
@vovs03
vovs03 / traffic-lights.rb
Created September 22, 2019 08:33
Traffic-ligths.rb
# Эмулятор работы светофора:
# Переключение рандомного цвета
# с интервалом через 5 секунд.
puts "Traffic-light is works!"
puts ""
sleep 2
def switch_color
light = ['Green', 'Yellow', 'Red']
10.times do
@vovs03
vovs03 / add-p.md
Created September 4, 2019 15:22 — forked from mattlewissf/add-p.md
Lightning Talk: Git add -p

git add -p is your friend

git add -p is basically "git add partial (or patch)"

Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history. This feature can improve the quality of the commits. It also makes it easy to remove parts of the changes in a file that were only there for debugging purposes - prior to the commit without having to go back to the editor.

It allows you to see the changes (delta) to the code that you are trying to add, and lets you add them (or not) separately from each other using an interactive prompt. Here's how to use it:

from the command line, either use

  • git add -p
@vovs03
vovs03 / README.md
Last active February 13, 2019 15:18
Борьба со входом в ОС Linux Mint 19 (после зависания компа)

ИКСЫ не принимают логин и пароль

2019-02-13 Уже 6 дней как в подвешенном состоянии (система не пашет) После зависания Экран приветствия стал в мелкую сеточку точками разлинован сами обои рабочего стола пользователя. И логин.пароль не принимается

Менял пароль, та же история. Пробовал через tty5 заходить - проблемы с работоспособностью команд(скриптов)

исправил, благодаря подсказке в irc-чате русском линукс-минте.

@vovs03
vovs03 / .bashrc
Created January 30, 2019 12:17
Settings ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@vovs03
vovs03 / gpu-61c(sensors).md
Last active December 7, 2018 10:22
Насторожило gpu =61C

gpu = 61C problem...

~ inxi -F
System:    Host: osart-011 Kernel: 4.15.0-42-generic x86_64 bits: 64 Desktop: Cinnamon 3.8.9
           Distro: Linux Mint 19 Tara
Machine:   Device: desktop Mobo: Gigabyte model: P35-S3 v: x.x serial: N/A BIOS: Award v: F4 date: 06/29/2007
CPU:       Dual core Intel Core2 Duo E6850 (-MCP-) cache: 4096 KB
           clock speeds: max: 3000 MHz 1: 1999 MHz 2: 1999 MHz
Graphics:  Card: NVIDIA GT218 [GeForce 210]
@vovs03
vovs03 / chordpro-install-log.md
Created December 3, 2018 11:29
Full install CHORDPRO log

Full install CHORDPRO log

2018-12-03 osart-011 Vladimir Pavlychev

➜  ~ sudo cpan install wxchordpro
[sudo] password for keyjoo: 
Loading internal null logger. Install Log::Log4perl for logging messages
@vovs03
vovs03 / README.md
Last active November 16, 2018 16:31
Check Palindrome [Ruby]

Example

For inputString = "aabaa", the output should be
checkPalindrome(inputString) = true;
For inputString = "abac", the output should be
checkPalindrome(inputString) = false;
For inputString = "a", the output should be
checkPalindrome(inputString) = true.

Input/Output

@vovs03
vovs03 / cron-start.md
Last active November 7, 2018 10:11
Cron + Postfix in DEB-systems

Cron

Note from 2018-11-07 08:55:23.489

crontab -u keyjoo -e

// add command 50 7 * * * keyjoo /bin/bash ~/code/scripts/hi.sh

Google