Skip to content

Instantly share code, notes, and snippets.

View viethung0o0's full-sized avatar

Phan Viet Hung viethung0o0

  • AsianTech inc.
  • Viet Nam
View GitHub Profile
@viethung0o0
viethung0o0 / JetBrainsActivation.md
Created September 3, 2024 15:33 — forked from noteeeeee/JetBrainsActivation.md
Webstorm/JetBrains products activation 2024 (Windows/MacOS)

Webstorm/JetBrains products activation 2024 (Windows/MacOS)

1.Proxy Settings

  1. Step 1: Navigate to Proxy settings.
  2. Step 2: Select "Manual proxy settings - HTTP".
    • Hostname: localhost
    • Port: 80

Set no proxy for:

@viethung0o0
viethung0o0 / nginx.conf
Created July 30, 2024 17:13 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@viethung0o0
viethung0o0 / webcrawler.js
Created March 24, 2022 03:14 — forked from amoilanen/webcrawler.js
Simple PhantomJS-based web crawler library
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
@viethung0o0
viethung0o0 / psql_useful_stat_queries.sql
Created January 6, 2022 18:57 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@viethung0o0
viethung0o0 / postgres_queries_and_commands.sql
Created December 29, 2020 03:45 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@viethung0o0
viethung0o0 / initWebhook.sh
Last active February 4, 2020 03:16
Setting ngrok domain to facebook webhook messenger
#!/bin/bash
# Setup:
# 1. sudo apt-get install jq
# 2. https://ngrok.com/download
# 3. sudo chmod a+x path/to/initWebhook.sh
# RUN: ./initWebhook.sh http domain.com 80
PROTO=${1:-http}
@viethung0o0
viethung0o0 / Instructions.sh
Created November 25, 2019 07:05 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@viethung0o0
viethung0o0 / EnsureQueueListenerIsRunning.php
Created July 17, 2017 06:30 — forked from ivanvermeyen/EnsureQueueListenerIsRunning.php
Ensure that the Laravel 5.1 queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
<?php
namespace App\Libs;
use Image;
class ImageHelper
{
/**
@viethung0o0
viethung0o0 / admin_index.blade.php
Last active April 11, 2017 10:59
Deletes checkbox item
@extends('backend.layouts.master')
@section('breadcrumb')
{!! Breadcrumbs::render('backend.admin.index') !!}
@endsection
@section('content')
<div class='table-header'>
<h1 class="pull-left">@lang('labels.admin.index')</h1>
<div class="pull-right">