Skip to content

Instantly share code, notes, and snippets.

@Tefnet
Tefnet / ImageMagick.spec
Created August 22, 2019 12:39
ImageMagick 6.8.9-10 spec file for AmazonLinux
%global VERSION 6.8.9
%global Patchlevel 10
Name: ImageMagick
Version: %{VERSION}
Release: %{Patchlevel}
Summary: Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition resize, rotate, shear, distort and transform images.
Group: Applications/Multimedia
License: http://www.imagemagick.org/script/license.php
Url: http://www.imagemagick.org/
@Tefnet
Tefnet / read-access.sql
Created June 20, 2018 08:55 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;

Keybase proof

I hereby claim:

  • I am tefnet on github.
  • I am jezier (https://keybase.io/jezier) on keybase.
  • I have a public key ASB6Yi_U4Om5zX61O12YG1x7lYorxA1Cq1mrZp5VCzqmnwo

To claim this, I am signing this object:

@Tefnet
Tefnet / install_ffmpeg_ubuntu.sh
Created September 19, 2017 19:45 — forked from seankross/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@Tefnet
Tefnet / mail-setup.sh
Last active September 2, 2021 12:49 — forked from trungpv93/mail-setup.sh
Install Postfix, Dovecot, RoundCube on Ubuntu 16.04
#!/usr/bin/env bash
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
DOMAIN="xxx.vn"
PASS_DB_ROUNDCUBE="xxx"
@Tefnet
Tefnet / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/bash
#
# pgpool-II replication manager
#
# Interfaces with pgpool's pcp command-line tools to provide access to common functions for managing
# load-balancing and failover.
#
# dsimmons@squiz.co.uk
# 2011-08-28
from eve import Eve
from eve.io.sqlalchemy import SQLAlchemy, Validator
import models
app = Eve(validator=Validator, data=SQLAlchemy)
db = app.data.driver
db.create_all()
if not db.session.query(models.People).count():
for item in models.test_data:
from eve import Eve
from eve.io.sqlalchemy import SQLAlchemy
app = Eve(data=SQLAlchemy)
db = app.data.driver
test_data = [
(u'George', u'Washington'),
@Tefnet
Tefnet / gist:4390089
Created December 27, 2012 17:24
SQLAlchemy DeclarativeMeta example
import sqlalchemy
import sqlalchemy.orm
import sqlalchemy.ext.declarative
class BaseClsMeta(sqlalchemy.ext.declarative.DeclarativeMeta):
def __init__(cls, classname, bases, dict_):
if getattr(cls, '__dupa__', False):
for i in range(10):
fname = 'fid%d' % i
dict_[fname] = sqlalchemy.Column(fname, sqlalchemy.types.Integer())