Skip to content

Instantly share code, notes, and snippets.

View baringji's full-sized avatar

Jofil Inoc Baring baringji

View GitHub Profile
@baringji
baringji / mysql.restore.md
Last active March 24, 2022 17:48
Restore MySQL tar.gz file using GNU zip (gunzip)

gunzip < [backupfile.sql.gz] | mysql -u[username] -p[password] [database]

@baringji
baringji / mysql.dump.md
Last active August 29, 2015 14:00
Create a MySQL dump using GNU zip (gzip).

mysqldump -u[username] -p[password] --add-drop-database -B [database] --opt | gzip -9 > filename.sql.gz

@baringji
baringji / chmod.directory.md
Last active November 21, 2016 08:49
Changing Linux directory permission recursively.

find [directory] -type d -exec chmod 755 {} ;

@baringji
baringji / chmod.file.md
Last active August 29, 2015 14:00
Changing Linux file permission recursively.

find [directory] -type f -exec chmod 644 {} ;

# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
@baringji
baringji / ffmpeg.avconv.split.md
Last active August 29, 2015 14:01
Split video using ffmpeg or avconv via terminal.

ffmpeg -acodec copy -vcodec copy -ss START -t LENGTH -i ORIGINALFILE OUTPUTFILE

avconv -c:v copy -c:a copy -ss START -t LENGTH -i ORIGINALFILE OUTPUTFILE

@baringji
baringji / pg.terminate.md
Created May 14, 2014 01:13
Disconnect database connections in PostgreSQL 9.2+.

select pg_terminate_backend(pid) from pg_stat_activity where datname = [database name];

@baringji
baringji / www.data.group.md
Last active August 29, 2015 14:03
Adding username to www-data group

sudo chown -R www-data:www-data [directory]

sudo usermod -a -G www-data username

<?php
/**
* ACF Layout
* @version 1.0 | November 12th 2013
* @author Beau Charman | http://twitter.com/beaucharman
* @link https://gist.github.com/beaucharman/7181406
* @license MIT license
*
* Logical layout automation for Advanced Custom Fields and it's Flexible Content Field add on.
@baringji
baringji / designer.html
Last active August 29, 2015 14:27
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;