Skip to content

Instantly share code, notes, and snippets.

View joglomedia's full-sized avatar
🏠
Working from home

Edi Septriyanto joglomedia

🏠
Working from home
View GitHub Profile
@joglomedia
joglomedia / ffmpeg_mkv_mp4_conversion.md
Created July 15, 2021 09:07 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@joglomedia
joglomedia / python-276-installer-centos.sh
Last active July 1, 2021 03:05
Install Python 2.7.3 on CentOS 5.x (tested on CentOS 5.10) # (c) 2013 - MasEdi (http://masedi.net/)
#!/bin/bash
# (c) 2013 - MasEdi (http://masedi.net/)
yum groupinstall "Development tools"
yum install zlib-devel
yum install bzip2-devel openssl-devel ncurses-devel automake make
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar zxf Python-2.7.3.tar.bz2
cd Python-2.7.3
./configure --prefix=/usr/local
@joglomedia
joglomedia / mautic.dev.conf (Mautic Nginx Configuration)
Last active January 26, 2021 06:16
Mautic Nginx Config (Install using Simple LNMP Installer - https://github.com/joglomedia/deploy) - Open Source Marketing Automation
server {
listen 80;
#listen [::]:80 default_server ipv6only=on;
## Make site accessible from world web.
server_name mautic.dev www.mautic.dev *.mautic.dev;
## Log Settings.
access_log /var/log/nginx/mautic.dev_access.log;
error_log /var/log/nginx/mautic.dev_error.log error;
@joglomedia
joglomedia / Setup SSH Key for Remote Server Password-less Login
Last active January 31, 2020 09:55
How to generate an SSH key and add public key to the server for authentication
## Generate a new SSH key
Follow this command, ensure that you change your-identifier with your own, it could be an unique name or email address (recommended)
```
$ ssh-keygen -t rsa -b 4096 -C "your-identifier"
```
An output from those command look like below.
If asked, simply press enter to follow the suggested value (/home/yours/.ssh/id_rsa)
cfg.parser () {
fixed_file=$(cat $1 | sed 's/ = /=/g') # fix ' = ' to be '='
IFS=$'\n' && ini=( $fixed_file ) # convert to line-array
ini=( ${ini[*]//;*/} ) # remove comments
ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix
ini=( ${ini[*]/%]/ \(} ) # convert text2function (1)
ini=( ${ini[*]/=/=\( } ) # convert item to array
ini=( ${ini[*]/%/ \)} ) # close array parenthesis
ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2)
ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis
@joglomedia
joglomedia / gitio
Created December 9, 2019 00:35 — forked from defunkt/gitio
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@joglomedia
joglomedia / curl.md
Created September 16, 2019 07:40 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

server {
# see: http://wiki.nginx.org/Pitfalls
# see: http://wiki.nginx.org/IfIsEvil
listen 80;
root /app;
index index.html index.htm index.php;
error_page 404 /index.php;
# Make site accessible from http://set-ip-address.xip.io
@joglomedia
joglomedia / my.cnf
Created August 31, 2019 02:08 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated December 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
@joglomedia
joglomedia / ssh_port_checker.sh
Created June 23, 2019 16:09 — forked from skamithi/ssh_port_checker.sh
Bash script to detect if SSH port is active on remote host. Used it orchestrating vm creation using ansible.
#!/bin/bash
# Script for checking if SSH port is open
# Only checks that port is open. Not that actually SSH connection can occur
counter=0
result="ssh disabled"
if [ -z "$1" ]
then
echo "hostname argument required. Example ssh_port_checker.sh 10.1.1.1"