Skip to content

Instantly share code, notes, and snippets.

View mikeshi80's full-sized avatar

Mike Shi mikeshi80

  • Shanghai Hyron Software Co Ltd.
  • Shanghai, China
View GitHub Profile
@justmiles
justmiles / mac.py
Last active August 19, 2020 10:24
OpenVPN post_auth MAC address check via JumpCloud
# OpenVPN Access Server MAC address checking post_auth script.
# Johan Draaisma
#
# This script can be used with LOCAL, PAM, LDAP, and RADIUS authentication.
# It adds an additional check when authentication is done through the VPN connection.
# It applies to all 3 connection profiles types (server-locked, user-locked, auto-login).
# Windows, Linux, and macOS will be reporting MAC addresses. However, Android and iOS
# devices will not, due to technical reasons. They will instead by reporting UUID. For
# simplicity and legacy reasons we will just call it MAC address from here on in, but
# it can be in theory any unique hardware-based string that the client reports to us.
@Hakky54
Hakky54 / openssl_commands.md
Last active April 19, 2024 10:58 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@gpetuhov
gpetuhov / ubuntu_usb_fix.txt
Last active February 7, 2024 02:31
Ubuntu USB autosuspend disable
If Android phone constantly disconnects:
1. Try to disable Ubuntu USB autosuspend
https://www.makeuseof.com/tag/fix-usb-device-port-linux/
cat /sys/module/usbcore/parameters/autosuspend
(if the result is 2, then autosuspend is enabled)
sudo nano /etc/default/grub
Change
@kekru
kekru / traefik-redirect-path.md
Last active March 12, 2024 15:15
Traefik redirect / (root) to sub path with Docker labels

Traefik: redirect base or root path to a subpath

This is tested with Traefik 1.7

This is how to redirect the root or base path to a sub path in Traefik using Docker labels:
Goals

  • https://example.com -> https://example.com/abc/xyz/
  • https://example.com/ -> https://example.com/abc/xyz/
  • https://example.com/something -> no redirect
@justinatack
justinatack / Quasar Framework Login Form Card Component Example
Last active November 2, 2023 22:22
Quasar Framework Login Form Card Component Example
<template>
<q-page class="bg-light-green window-height window-width row justify-center items-center">
<div class="column">
<div class="row">
<h5 class="text-h5 text-white q-my-md">Company & Co</h5>
</div>
<div class="row">
<q-card square bordered class="q-pa-lg shadow-1">
<q-card-section>
<q-form class="q-gutter-md">
@duhaime
duhaime / measure_img_similarity.py
Last active March 1, 2023 08:41
Compare image similarity in Python using Structural Similarity, Pixel Comparisons, Wasserstein Distance (Earth Mover's Distance), and SIFT
import warnings
from skimage.measure import compare_ssim
from skimage.transform import resize
from scipy.stats import wasserstein_distance
from scipy.misc import imsave
from scipy.ndimage import imread
import numpy as np
import cv2
##
@dvlden
dvlden / ffmpeg.md
Last active April 17, 2024 19:53
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@daicham
daicham / .gitlab-ci.yml
Last active May 3, 2023 07:05
A sample of .gitlab-ci.yml for a gradle project
image: java:8-jdk
stages:
- build
- test
- deploy
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
# !/usr/bin/env python
# -*- coding:utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class overlay(QWidget):
def __init__(self, parent=None):
super(overlay, self).__init__(parent)