Skip to content

Instantly share code, notes, and snippets.

View gwsu2008's full-sized avatar

Guang gwsu2008

View GitHub Profile
@gwsu2008
gwsu2008 / cmdbuild.sh
Created September 19, 2023 20:54 — forked from sinofool/cmdbuild.sh
A script to override xcode project configurations
#!/bin/bash
set -x
USAGE() {
cat << EOF
Usage: ${0##*/} <-i ident.p12> [-p password] <-m profile.mobileprovision> [-a com.example.app] [-n NewName] [-I Info.plist]
-i ident.p12 The signing identity file.
-p password The password of signing identity file.
-m profile.mobileprovision Signing provision profile
-a com.example.app Override CFBundleIdentifier
@gwsu2008
gwsu2008 / gist:4096ae9714f9a59a3a8736cadede9db3
Created May 15, 2023 21:25 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
Each Jenkins page has a REST API hyperlink at the bottom, this is because each page has its own endpoint.
http://localhost:8080/me
configure
Click 'Show API Token'
78e21f82a9e137614fef5b9593bcf827 = API Token
curl -s -u goll:78e21f82a9e137614fef5b9593bcf827 http://localhost:8080/crumbIssuer/api/json
@gwsu2008
gwsu2008 / remove-git-lfs.md
Created August 16, 2022 21:28 — forked from everttrollip/remove-git-lfs.md
Removing git lfs from (any) repository

So, it has been an interesting journey, but time to remove git-lfs. Here follows a summary of the approach I used to safely remove git-lfs,

  • commit & push everything
  • create a branch, something like fix/remove-lfs
  • remove hooks git lfs uninstall
  • remove lfs stuff from .gitattributes (open file, delete content - don't delete the file!)
  • list all lfs files, git lfs ls-files
  • run git rm --cached for each file
    • if your list is big, copy the contents into a file.txt
  • make sure you remove the number and asterik on each line, you only want the paths to the files
@gwsu2008
gwsu2008 / Jenkins+Script+Console.md
Created February 19, 2022 19:52 — forked from mubbashir/Jenkins+Script+Console.md
jenkins groovy scripts collection.
@gwsu2008
gwsu2008 / Useful GitHub Links
Last active November 17, 2021 16:47
Useful GitHub Links
@gwsu2008
gwsu2008 / envelope_encryption_kms_boto_pycrypto.md
Created November 17, 2021 16:35 — forked from pmp/envelope_encryption_kms_boto_pycrypto.md
Envelope Encryption using AWS KMS, Python Boto, and PyCrypto.

If you use Amazon AWS for nearly anything, then you are probably familiar with KMS, the Amazon Key Management Service.

KMS is a service which allows API-level access to cryptographic primitives without the expense and complexity of a full-fledged HSM or CloudHSM implementation. There are trade-offs in that the key material does reside on servers rather than tamper-proof devices, but these risks should be acceptable to a wide range of customers based on the care Amazon has put into the product. You should perform your own diligence on whether KMS is appropriate for your environment. If the security profile is not adequate, you should consider a stronger product such as CloudHSM or managing your own HSM solutions.

The goal here is to provide some introductory code on how to perform envelope encrypt a message using the AWS KMS API.

KMS allows you to encrypt messages of up to 4kb in size directly using the encrypt()/decrypt() API. To exceed these limitations, you must use a technique called "envelope encryptio

@gwsu2008
gwsu2008 / s3_full_delete.py
Created October 9, 2021 22:56 — forked from vsx-gh/s3_full_delete.py
Remove completely S3 objects that have delete markers
#!/usr/bin/env python3
'''
Program: s3_full_delete.py
Author: https://github.com/vsx-gh
Created: 20170920
Program finds S3 objects with delete markers and deletes all versions
of those objects.
@gwsu2008
gwsu2008 / java-script-time.js
Created May 27, 2021 17:28
java-script-time.js
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the date and time as a string.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
@gwsu2008
gwsu2008 / python-random-password
Created August 17, 2020 04:17
python-random-password
FROM: https://gist.github.com/prgrm/a85d2da1a1be791bfdd6/raw/91f343659e917f2b8a94b73d5b5b0e44ac40be4b/Ex15
# generate a password with length "passlen" with no duplicate characters in the password
import random
s = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?"
passlen = 8
p = "".join(random.sample(s,passlen ))
print p