Skip to content

Instantly share code, notes, and snippets.

@edwardstock
edwardstock / drive_backup.sh
Last active August 10, 2017 21:19
GoogleDrive files backup with "gdrive" https://github.com/prasmussen/gdrive
#!/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 March 19, 2017 10:43
How to build PHP 7 (nginx + fpm+cli) on debian/ubuntu
#!/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 18:11
Strict ADB logging (only app logs and few important android)
^(?!(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 July 1, 2017 12:03 — forked from beci/gcc 5 on ubuntu 14.04
use gcc 5.x 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 August 11, 2017 15:46
How to GIT ignore: global ignoring files
# 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 August 11, 2017 16:00 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
/*
* Copyright 2017 Eduard Maximovich
* Atlas
*/
apply plugin: 'maven'
version = VERSION_NAME
group = GROUP
@edwardstock
edwardstock / centos.install.boost.md
Last active April 2, 2018 15:23 — forked from 1duo/centos.install.boost.md
Install Boost library from source on CentOS 7.
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
#!/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
# 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