Skip to content

Instantly share code, notes, and snippets.

@minhtuanvu
minhtuanvu / my.cnf
Created May 25, 2022 10:31 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@minhtuanvu
minhtuanvu / intel-nvidia.md
Created October 19, 2021 03:15 — forked from wangruohui/intel-nvidia.md
Intel for display, Nvidia for computing

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
@minhtuanvu
minhtuanvu / configure_cuda_p70.md
Created October 19, 2021 03:14 — forked from alexlee-gk/configure_cuda_p70.md
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

@minhtuanvu
minhtuanvu / android_Fastlane
Created October 19, 2021 03:12 — forked from jukben/android_Fastlane
Example of Circle CI config for React Native CI (Appcenter, Kotlin, Swift, RN 0.49+, Haul packager, signing via Match, be sure that you have set env MATCH_PASSWORD, FASTLANE_PASSWORD and SLACK_URL)
fastlane_version "2.64.1"
default_platform :android
platform :android do
lane :beta do
gradle(task: "assembleRelease")
appcenter_upload(
api_token: "",
@minhtuanvu
minhtuanvu / README.md
Created October 19, 2021 03:12 — forked from kevprice83/README.md
3scale Developer portal custom signup flows

Dynamic 3scale Developer Portal signup templates

There are 4 custom signup flows included in the parent homepage. These flows are included into the homepage using Liquid tags such as {% include 'partial name' %} because the flows are separated out into individual partials. The partials can be included in your 3scale portal individually or all together depending on which flows you want to enable in your portal and for ease of switching between flows as and when needed.

NOTE: If you prefer you can create a separate page to render the subscription forms to the different Services. This would be particularly useful if you want to allow multiple applications per account for the Custom Field & Group Membership Flows.

How does the 3scale signup work?

The Basics

A developer can sign up to subscribe to an API service in various ways

3scale - Importing a Swagger API Configuration

This tutorial shows how to import a Swagger API Configuration into a 3scale service. A Swagger API configuration of this free-to-use Pet Store Service will be used in this tutorial to import, replicate, and test the endpoints offered by the service, all within the 3scale Management Platform and 3scale CLI.

1. Create a 3scale account

  1. Navigate to the Sign Up page.

  2. Complete the following fields:

@minhtuanvu
minhtuanvu / server.py
Created September 22, 2021 08:41 — forked from rockedscience/server.py
Simple HTTP server in Python to test incoming connections
import socket
import logging
import datetime
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
class HTTPRequest(BaseHTTPRequestHandler):
def __init__(self, request_text):
self.rfile = StringIO(request_text)
Feel free to download by right-clicking in your Google Chrome browser and selecting: Save Image As.
Afterwards, study diagram in an image viewer that allows for zooming into more of the details.
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)