Skip to content

Instantly share code, notes, and snippets.

View hightemp's full-sized avatar
🎯
Focusing

Anton Panov hightemp

🎯
Focusing
View GitHub Profile
@hightemp
hightemp / git.md
Created May 25, 2020 09:58 — forked from dustinmartin/gist:2966397
Git Command Cheatsheet

Setup

git clone clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

[color]

@hightemp
hightemp / reflog.sh
Created May 25, 2020 09:30 — forked from nickolasburr/reflog.sh
reflog: Pretty format `git reflog show` with optional flag options for refining reflog output
#!/usr/bin/env bash
# reflog: Pretty format `git reflog show` with optional flag options for refining reflog output
reflog () {
if [[ ! "$(git rev-parse --is-inside-work-tree)" ]] 2>/dev/null; then
echo "fatal: Not a git repository (or any of the parent directories): .git"
return 1
fi
# decorated `git reflog show` graph format style
@hightemp
hightemp / docker_import_host.sh
Last active May 18, 2020 00:05
docker import host system
sudo su -
cd /
#tar -cpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys /
#scp user@server-uri:path_to_file/backup.tar.gz .
tar zcvf --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/srv - / | ssh $1@$2 "cat > /home/$1/frontdev.tar.gz"
echo 'cat /home/$1/frontdev.tar.gz | docker import - frontdev:v1.0'
echo 'docker run -t -i frontdev:v1.0 /bin/bash'
@hightemp
hightemp / electron_maximize.js
Last active May 17, 2020 11:01
vue electron maximize
<q-btn v-if="$q.platform.is.desktop" dense @click="fnMinimizeWindow" icon="expand_more" />
<q-btn v-if="$q.platform.is.desktop" dense @click="fnMaximizeWindow" :icon="m_bWindowIsMaximized ? 'unfold_more' : 'expand_less'" />
<q-btn v-if="$q.platform.is.desktop" dense @click="fnCloseWindow" icon="close" />
/* ... */
computed: {
bWindowIsMaximized: {
set(bValue) {
if (process.env.MODE === 'electron') {
@hightemp
hightemp / Debugger.class.php
Last active May 23, 2020 13:06
php debugger/logger
<?php
if (defined('DA_FLAG')) {
return 'defined DA_FLAG';
}
// [!] Все пути должны быть без / на конце
define('DA_ROOT_DIR', __DIR__);
define('DA_LOGS_DIR', DA_ROOT_DIR."/logs");
define('DA_FLAG_FILE', DA_LOGS_DIR."/dws_debugger.flag");
@hightemp
hightemp / httpd1
Created May 12, 2020 05:10
multi service unit file
PORT=8000
PID_FILE=/etc/httpd/run/httpd1.pid
@hightemp
hightemp / ws.js
Created May 11, 2020 19:57
websocket wait for connection
// const WebSocket = require('ws');
export class DockerWS
{
oWebSocket = null
bConnected = false
oResultsGroupedByMethods = {}
oCallbacksGroupedByMethods = {}
@hightemp
hightemp / promt.sh
Created May 10, 2020 21:53
bash_promt
function find_git_branch()
{
local branch
if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then
if [[ "$branch" == "HEAD" ]]; then
branch='detached*'
fi
git_branch="($branch)"
else
git_branch=""
@hightemp
hightemp / notes
Created April 10, 2020 21:03 — forked from justincormack/notes
criu setup Ubuntu 18.04
apt update
apt upgrade
apt install build-essential
apt install pkg-config
apt install libnet-dev python-yaml libaio-dev
apt install libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libcap-dev python-future
# criu install
curl -O -sSL http://download.openvz.org/criu/criu-3.10.tar.bz2
tar xjf criu-3.10.tar.bz2
@hightemp
hightemp / README-setup-tunnel-as-systemd-service.md
Created March 8, 2020 16:23 — forked from drmalex07/README-setup-tunnel-as-systemd-service.md
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target