Skip to content

Instantly share code, notes, and snippets.

View k1ng440's full-sized avatar
💡
Looking For Opportunity

Asaduzzaman Pavel k1ng440

💡
Looking For Opportunity
View GitHub Profile
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Asaduzzaman \"Asad\" Pavel",
"label": "Backend Software Engineer",
"email": "contact@iampavel.dev",
"phone": "+880 175 565 5440",
"website": "https://iampavel.dev",
@k1ng440
k1ng440 / WSL2-Net-Fix.ps1
Last active September 25, 2022 21:26 — forked from danvy/WSL2-Net-Fix.ps1
Reset your WSL network connection trying to fix WSL2 media disconnected error
# Check these threads before proceeding:
# https://github.com/microsoft/WSL/discussions/5857
# https://github.com/microsoft/WSL/issues/5821
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
$CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine
Exit
}
@k1ng440
k1ng440 / magefile.go
Created October 2, 2018 16:57
Versioning with mage
// +build mage
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
@k1ng440
k1ng440 / bitbucket-pipelines.yml
Created September 13, 2018 01:03 — forked from adilsoncarvalho/bitbucket-pipelines.yml
Bitbucket Pipelines deployment to a Google Container Engine configuration
options:
docker: true
pipelines:
branches:
master:
- step:
image: google/cloud-sdk:latest
name: Deploy to production
deployment: production
caches:
@k1ng440
k1ng440 / install.md
Created July 22, 2017 20:11
Install geth, gubiq, go-dubaicoin on ubuntu

install build tool and go lang

sudo apt-get update
sudo apt-get install build-essential
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install -y golang-go

Go Ethereum

@k1ng440
k1ng440 / transient-clustering-gnu-parallel-sshfs.md
Created May 5, 2017 20:36 — forked from Brainiarc7/transient-clustering-gnu-parallel-sshfs.md
How to set up a transient cluster using GNU parallel and SSHFS for distributed jobs (such as FFmpeg media encodes)

Transient compute clustering with GNU Parallel and sshfs:

GNU Parallel is a multipurpose program for running shell commands in parallel, which can often be used to replace shell script loops,find -exec, and find | xargs. It provides the --sshlogin and --sshloginfile options to farm out jobs to multiple hosts, as well as options for sending and retrieving static resources and and per-job input and output files.

For any particular task, however, keeping track of which files need to pushed to and retrieved from the remote hosts is somewhat of a hassle. Furthermore, cancelled or failed runs can leave garbage on the remote hosts, and if input and output files are large, sending them to local disk on the remote hosts is somewhat inefficient.

In a traditional cluster, this problem would be solved by giving all nodes access to a shared filesystem, usually with NFS or something more exotic. However, NFS doesn't wo

@k1ng440
k1ng440 / post_to_slack.rb
Created May 4, 2017 17:35 — forked from jlecour/post_to_slack.rb
How to post alerts from Monit to Slack
# encoding: UTF-8
require 'optparse'
require 'net/http'
require 'json'
def parse_options(argv)
opts = {}
@parser = OptionParser.new do |o|
@k1ng440
k1ng440 / install.sh
Created May 4, 2017 14:20
install ffmpeg with fdkaac
apt-get update
apt-get -y install autoconf automake build-essential git-core libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev nasm gcc yasm && true
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
@k1ng440
k1ng440 / File.php
Created March 22, 2016 06:54 — forked from andheiberg/File.php
Server side part of FineUploader
<?php namespace Models;
use \AWS;
class File extends BaseModel {
/**
* The database table used by the model.
*
* @var string
@k1ng440
k1ng440 / gist:6dd72b98269794132d0b
Last active August 29, 2015 14:08
Read file backward
<?php
class ReverseFile implements Iterator
{
const BUFFER_SIZE = 4096;
const SEPARATOR = "\n";
public function __construct($filename)
{
$this->_fh = fopen($filename, 'r');
$this->_filesize = filesize($filename);