Skip to content

Instantly share code, notes, and snippets.

View GregNing's full-sized avatar
🏹
typing

GregYang GregNing

🏹
typing
View GitHub Profile
@GregNing
GregNing / sidekiq_monitoring
Created July 4, 2024 08:12 — forked from ngsmrk/sidekiq_monitoring
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
@GregNing
GregNing / imagemagick-ubuntu.txt
Last active April 12, 2024 09:53 — forked from nickferrando/imagemagick-ubuntu.txt
Install ImageMagick with JPG, PNG and TIFF Delegates - Ubuntu (20.04)
#These are the steps required in order to Install ImageMagick with JPG, PNG and TIFF delegates.
sudo apt-get update
#Install Build-Essential in order to configure and make the final Install
sudo apt-get install build-essential
#libjpg62-dev required in order to work with basic JPG files
@GregNing
GregNing / gist:5b642d86bd57305a83ebf2c3a707312a
Created June 16, 2023 02:05 — forked from RiANOl/gist:1077760
AES128 / AES256 CBC with PKCS7Padding in Ruby
require "openssl"
require "digest"
def aes128_cbc_encrypt(key, data, iv)
key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize)
iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize)
aes = OpenSSL::Cipher.new('AES-128-CBC')
aes.encrypt
aes.key = key
aes.iv = iv
@GregNing
GregNing / gist:5eeb3e48915ac164471770ecc9b9001c
Created May 23, 2023 09:32 — forked from ericchen/gist:3081968
ruby openssl AES encrypt and decrypt
require 'base64'
require 'digest'
require 'openssl'
module AESCrypt
def AESCrypt.encrypt(password, iv, cleardata)
cipher = OpenSSL::Cipher.new('AES-256-CBC')
cipher.encrypt # set cipher to be encryption mode
cipher.key = password
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GregNing
GregNing / README.md
Last active May 31, 2024 04:42
ssh to ec2 and send notification to slack
@GregNing
GregNing / taiwan-district-zip-code.json
Created December 17, 2020 10:56
台灣郵遞區號英文版本
{
"cities": [
{
"name": "Taipei City",
"code": 100,
"region": [
{ "name": "Zhongshan District", "code": 104 },
{ "name": "Da-an District", "code": 106 },
{ "name": "Xinyi District", "code": 110 },
{ "name": "Neihu District", "code": 114 },
@GregNing
GregNing / Dockerfile
Last active May 31, 2022 01:40
Dockerfile
FROM ruby:2.7.0-slim
MAINTAINER Greg
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends tzdata default-libmysqlclient-dev \
build-essential sudo git curl ssh openssh-client && \
sudo apt-get install -y nodejs yarn && \
apt-get clean autoclean && \
apt-get purge -y --auto-remove && \
@GregNing
GregNing / _vue-rails.md
Created September 24, 2019 08:54 — forked from przbadu/_vue-rails.md
Vue js and Rails integration

Setup Rails and Vuejs

  1. Generate new rails app using --webpack flag
rails new myApp --webpack=vue

Note:

  1. You can use --webpack=angular for angular application and --webpack=react for react.