Skip to content

Instantly share code, notes, and snippets.

Avatar

Eduard edwardstock

  • Turkey, Antalya
View GitHub Profile
View drive_backup.sh
#!/bin/sh
# Example cron usage:
# 0 12 * * MON /usr/bin/drive_backup /var/www/public/ >> /var/log/drive_backup.log
# ^every monday at 12:00PM ^path to backup on google drive ^stream redirect ^path to backup log
# Basic manual usage
# drive_backup /path/to/directory/or/file
# File names will contains full path and date for uniqueness.
@edwardstock
edwardstock / buildphp_deb.sh
Last active Mar 19, 2017
How to build PHP 7 (nginx + fpm+cli) on debian/ubuntu
View buildphp_deb.sh
#!/usr/bin/env bash
# getting deps
apt-get install -y git make gcc g++ autoconf re2c bison \
libxml2 libxml2-dev \
libevent-2.0* libevent-dev \
libssl1.0.0 libssl-dev \
libzip2 libzip-dev \
libbz2-dev \
libgd3 libgd-dev \
libmcrypt4 libmcrypt-dev \
@edwardstock
edwardstock / filter.regexp
Last active May 28, 2020
Strict ADB logging (only app logs and few important android)
View filter.regexp
^(?!(FA|Settings|ea|MultiDex|OpenGLRenderer|art|FirebaseApp|System\.out|FirebaseInitProvider|Adreno\-EGL|ApplicationLoaders|dalvikvm|eglCodecCommon|SQLiteDatabase|NativeCrypto|Surface|MALI|GraphicBuffer|MultiWindow|HttpUrlPinger|FeatureProxyBase|InputMethodManager|libc\-netbsd|AudioCapabilities|VideoCapabilities|Proxy|InstantRun|PhoneWindow|ViewRootImpl|PhoneWindow|ResourceManager|OpenSSLLib|ResourcesManager|AnalyticsService|cr\_BindingManager|AccessibilityManager|ProgramBinary|\[MALI\]\[Gralloc\]|MPlugin|Posix|WifiManager|cr\_LibraryLoader|CellLocation|MaliEGL|WebView|linked|cr_BrowserStartup|ExifInterface\_JNI|cr\_Ime|FirebaseInstanceId|InputTransport|TelephonyManager|mali\_winsys|PlayCommon|Places|ExifInterface|ThermalEngine|WifiHAL|BatteryStatsService|OcrModelUpStIntentOp|LightsService|tigonliger|NetRec|Finsky|SingleFileAttributeStore|cr_media|libEGL|NetworkSecurityConfig|AppMetrica|HostConnection|DynamiteModule|GAv4|inter.bipwalle|EGL_emulation|libc|skia|Gralloc3))
^(?!(Accessing hidden))
@edwardstock
edwardstock / gcc 5 on ubuntu 14.04
Created Jul 1, 2017 — forked from beci/gcc 5 on ubuntu 14.04
use gcc 5.x on ubuntu 14.04
View gcc 5 on ubuntu 14.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
@edwardstock
edwardstock / git_global_ignore.sh
Created Aug 11, 2017
How to GIT ignore: global ignoring files
View git_global_ignore.sh
# Command to use global .gitignore file:
touch ~/.gitignore
echo ".DS_STORE" >> ~/.gitignore
echo ".idea/" >> ~/.gitignore
git config --global core.excludefile '~/.gitignore'
@edwardstock
edwardstock / .gitignore
Created Aug 11, 2017 — forked from octocat/.gitignore
Some common .gitignore configurations
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
View atlas-mvn-push.gradle
/*
* Copyright 2017 Eduard Maximovich
* Atlas
*/
apply plugin: 'maven'
version = VERSION_NAME
group = GROUP
@edwardstock
edwardstock / centos.install.boost.md
Last active Apr 2, 2018 — forked from 1duo/centos.install.boost.md
Install Boost library from source on CentOS 7.
View centos.install.boost.md
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
  • Unzip
tar -xzf boost_1_65_1.tar.gz && cd boost_1_65_1
View centos.install.gcc7.sh
#!/bin/bash
yum install centos-release-scl
yum install devtoolset-7-gcc*
# enable bin (originally installed to /opt/rh/devtoolset-7/root/ )
# scl exports to $PATH /opt/rh/devtoolset-7/root/bin/*
scl enable devtoolset-7 bash
# check
`which g++` -v
View pgsql.helpers.sh
# init new database
# dir: /usr/pgsql-$VERS
initdb -A trust --auth-local=trust --encoding=UTF8 --pgdata=/var/pgsql10
# dump old database (-O [--no-owners] - drops owners assignment, by default in new db's rights will grant to importer)
pg_dumpall -O -U postgres > /var/db.out
# import database dump
psql -f db.out postgres