Skip to content

Instantly share code, notes, and snippets.

View y-fedorov's full-sized avatar
🧑‍💻

Yaroslav Fedorov y-fedorov

🧑‍💻
View GitHub Profile
@y-fedorov
y-fedorov / .screenrc
Created April 17, 2017 12:47
screen config for tmux like bindings config
# Oracle Linux 6.* there is no support for the tmux, but I really like tmux.
#
# based on https://gist.github.com/jelsas/864090
#remap Ctrl+A to Ctrl+B
escape ^Bb
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
set CLASSPATH=%CLASSPATH;fop\fop-2.2.jar;fop\avalon-framework-api-4.3.1.jar;fop\avalon-framework-impl-4.3.1.jar;fop\commons-logging-1.0.4.jar;fop\commons-io-1.3.1.jar;fop\fontbox-2.0.4.jar;fop\xmlgraphics-commons-2.2.jar
java org.apache.fop.fonts.apps.TTFReader arial.ttf arial.xml
java org.apache.fop.fonts.apps.TTFReader DejaVuSans.ttf DejaVuSans.xml
java org.apache.fop.fonts.apps.TTFReader DejaVuSans-Bold.ttf DejaVuSans-Bold.xml
java org.apache.fop.fonts.apps.TTFReader DejaVuSans-BoldOblique.ttf DejaVuSans-BoldOblique.xml
java org.apache.fop.fonts.apps.TTFReader DejaVuSans-Oblique.ttf DejaVuSans-Oblique.xml
@y-fedorov
y-fedorov / gdb.sh
Created December 4, 2017 15:24
GDB usage example
-bash-4.1$ gdb
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-75.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
@y-fedorov
y-fedorov / install-docker.sh
Last active August 30, 2024 18:40 — forked from frgomes/install-docker.sh
Debian - install docker in Debian Jessie
#!/bin/bash
# prepare envirionment
sudo apt-get install tmux vim sudo
add `username` to `sudo` group
usermod -aG sudo `username`
# compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit
@y-fedorov
y-fedorov / script.sh
Created February 14, 2018 11:44
Install Docker Oracle Linux 7
#
# Install Docker Oracle Linux 7
# based on https://blogs.oracle.com/hlsu/install-docker-on-oracle-linux-7
#
# Preparation
sudo yum install -y vim
# cd /etc/yum.repos.d/
# curl -O http://yum.oracle.com/public-yum-ol7.repo
# debian
apt-get install vim curl sudo tmux htop mc
apt-get install git
@y-fedorov
y-fedorov / BubbleSort.cpp
Last active May 22, 2018 08:00
BubbleSort.cpp
#include <vector>
#include <iostream>
template<class T>
std::vector<T> bubbleSort(std::vector<T> data) {
bool changed;
do {
changed = false;
@y-fedorov
y-fedorov / stringRotate.cpp
Last active May 22, 2018 09:18
String Rotate
#include <vector>
#include <iostream>
#include <string>
std::string simpleRotate(const std::string data) {
return std::string(data.rbegin(), data.rend());
}
std::string badRotate(std::string data) {
auto size = data.size();
@y-fedorov
y-fedorov / RLE.cpp
Last active May 22, 2018 08:46
Run-length encoding implementation Example
#include <vector>
#include <iostream>
#include <sstream>
std::string RLE(std::string data) {
std::stringstream ss;
auto size = data.size();
size_t sequenceCounter = 0;
for (size_t i = 0; i < size; i++) {
auto currentChar = data[i];
@y-fedorov
y-fedorov / validNumber.cpp
Created June 13, 2018 10:35
65. Valid Number
/*
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true