Skip to content

Instantly share code, notes, and snippets.

View long25vn's full-sized avatar
🌴
On vacation

Nguyễn Thành Long long25vn

🌴
On vacation
View GitHub Profile
@long25vn
long25vn / gist:32337e66dec4d54bc68baae9d045d015
Created October 17, 2023 10:41 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@long25vn
long25vn / HttpProxy.go
Created March 13, 2022 10:00 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@long25vn
long25vn / opt1_template.j2
Created October 9, 2021 04:06 — forked from halberom/opt1_template.j2
ansible - example of template if else
{# style 1 - long form #}
{% if filepath == '/var/opt/tomcat_1' %}
{% set tomcat_value = tomcat_1_value %}
{% else %}
{% set tomcat_value = tomcat_2_value %}
{% endif %}
{# style 2 - short form #}
{% set tomcat_value = tomcat_1_value if (filepath == '/var/opt/tomcat_1') else tomcat_2_value %}
@long25vn
long25vn / AnsibleTooManyAuthenticationFailures.md
Created October 8, 2021 09:42 — forked from bmurithi/AnsibleTooManyAuthenticationFailures.md
Ansible SSH too many authentication failures

This exception appears to affect ansible when a playbook is executed from a host with several identities configured in the SSH agent (Tested on a development machine with 12 private keys).

I've noted this exception to be particulary common with AWS targets

Inventory configuration

Most tasks will run fine when we configure our inventory to use a specific private key.

We also need to set the IdentitiesOnly flag so that ssh does not attempt other authentication strategies.

@long25vn
long25vn / Docker connect to remote server.md
Created July 23, 2021 17:53 — forked from kekru/Docker connect to remote server.md
Connect to another host with your docker client, without modifying your local Docker installation

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

@long25vn
long25vn / 00_README.md
Created June 24, 2021 14:30 — forked from YumaInaura/00_README.md
Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

I was so confused to understand behaviior of Golang channels, buffer, blocking, deadlocking and groutines.

I read Go by Example topics.

@long25vn
long25vn / Fetch-API-cheat-sheet.md
Created May 25, 2021 13:43 — forked from jsdf/Fetch-API-cheat-sheet.md
Fetch API cheat sheet

fetch api cheat sheet

get JSON

fetch('/things/10', {
  credentials: 'same-origin',
  headers: {
    'accept': 'application/json'
  }
@long25vn
long25vn / Jenkinsfile
Created July 9, 2020 04:18 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@long25vn
long25vn / validation_rules.go
Created July 3, 2020 03:55 — forked from apzuk3/validation_rules.go
Validation rules
package main
import "fmt"
type User struct {
Email string `json:"email" validate:"required,email"`
Name string `json:"name" validate:"required,min=2,max=100"`
}
func main() {