Skip to content

Instantly share code, notes, and snippets.

@hieu-tn
hieu-tn / role.sh
Created July 16, 2022 20:05
[database] create role and grant access to tables following a text file
#!/bin/bash
############################################################
# Usage #
############################################################
usage()
{
# Display Help
echo ""
// Default Preferences.sublime-settings
{
"ignored_packages":
[
"Vintage",
],
"font_face": "Consolas",
"font_size": 16,
"match_brackets_angle": true,
"save_on_focus_lost": true,
@hieu-tn
hieu-tn / functions.php
Created September 15, 2020 04:31
WP Postview log
<?php
/**
* WordPress basically doesn't support how many views a post has. Therefore, we need to undertake our own implementation.
*
**/
require_once get_stylesheet_directory() . '/postview_log.php';
PostViewLog::get_instance();
ffmpeg -i input.mov -c:v libx264 -profile:v main -vf format=yuv420p -c:a aac -movflags +faststart output.mp4
ffmpeg -i input.mov -acodec libvorbis -b:a 96k -ac 2 -vcodec libvpx -b:v 400k -f webm output.webm
@hieu-tn
hieu-tn / docker.sh
Created August 20, 2020 15:13
Dockerize
docker container rm -f $(docker ps -aq) && docker volume prune
docker-compose down && docker-compose up
docker-compose up --build
@hieu-tn
hieu-tn / k8s.sh
Created August 20, 2020 15:12
k8s commands
kubectl get pods -n your_namespace | grep Evicted | awk '{print $1}' | xargs kubectl delete pod -n your_namespace
kubectl describe service ingress-nginx-controller -n ingress-nginx
kubectl get ingress --all-namespaces
kubectl get svc --all-namespaces
kubectl get deployment --all-namespaces
<html>
<head>
<style>
.thumbnail{
position: relative;
overflow: hidden;
padding-bottom: 56%;
}
.thumbnail img{
position: absolute;