Skip to content

Instantly share code, notes, and snippets.

View wingsum93's full-sized avatar
🎯
Focusing

eric ho wingsum93

🎯
Focusing
  • Hong Kong
View GitHub Profile
@wingsum93
wingsum93 / Transfer google vm image between different account
Created September 24, 2021 16:32
Transfer google vm image between different account
gcloud alpha compute images export --destination-uri gs://yourbucket/yourimagename.vmdk --image yourImageName --export-format vmdk --project yourProjectID
gcloud alpha compute images export --destination-uri gs://j111-cloud/vmold.vmdk --image j-image --export-format vmdk --project calendardate-1618304432238
gsutil cp gs://j111-cloud/vmold.vmdk gs://james-2021/vmnew.vmdk
@wingsum93
wingsum93 / doc.md
Created July 21, 2019 05:13
Ffmpeg Command Brief

ffmpeg -i input.mp4 -c:v vp9 -c:a libvorbis output.mkv

ffmpeg -i input.webm -c:v copy -c:a flac output.mkv

ffmpeg -i input.webm -c:av copy output.mkv

ffmpeg -i input.webm -c:a copy -c:v vp9 -b:v 1M output.mkv

ffmpeg -i input.webm -c:a copy -c:v vp9 -r 30 output.mkv

@wingsum93
wingsum93 / git.md
Last active July 16, 2019 03:50
Change & See the date of a git commit

Set the date of the last commit to the current date

GIT_COMMITTER_DATE="$(date)" git commit --amend --no-edit --date "$(date)"

Set the date of the last commit to an arbitrary date

GIT_COMMITTER_DATE="Tue 16 Jul 2019 12:00:11 HKT" git commit --amend --no-edit --date "Tue 16 Jul 2019 12:00:11 HKT"

Set the date of an arbitrary commit to an arbitrary or current date

import org.junit.Test
class CharSubSetTest {
@Test
fun xxx() {
val case1 = isSubset(arrayOf('A', 'B', 'C', 'D', 'E'), arrayOf('A', 'D', 'E'))
val case2 = isSubset(arrayOf('A', 'B', 'C', 'D', 'E'), arrayOf('A', 'D', 'Z'))
val case3 = isSubset(arrayOf('A', 'D', 'E'), arrayOf('A', 'A', 'D', 'E'))
@wingsum93
wingsum93 / SharedPreferenceDelegate.kt
Last active December 12, 2017 05:30
kotlin pref convient
private class SharedPreferenceDelegate<T>(
private val context: Context,
private val defaultValue: T,
private val getter: SharedPreferences.(String, T) -> T,
private val setter: Editor.(String, T) -> Editor,
private val key: String
) : ReadWriteProperty<Any, T> {
private val safeContext: Context by lazyFast { context.safeContext() }
<?xml version="1.0" encoding="utf-8"?>
<!--
Google Material Design Color Palette for Android http://www.google.com/design/spec/style/color.html#color-ui-color-palette
Spreadsheet used to create this reosurce - http://bit.ly/mdcolor_spreadsheet
Link to this colors.xml resource file - http://bit.ly/mdcolorsxml
Harshad Kale
https://github.com/kalehv
harshad.kale@gmail.com
@wingsum93
wingsum93 / Dockerfile
Created January 10, 2017 06:01
a docker build file for instance use mysql docker container
# author: eric ho
FROM mysql:latest
ENV MYSQL_ROOT_PASSWORD root
ENV MYSQL_DATABASE eric
ENV MYSQL_USER eric
ENV MYSQL_PASSWORD eric
ENV MYSQL_ROOT_HOST %
ENV MYSQL_DATABASE WMS
CMD mysql
CMD use mysql;
@wingsum93
wingsum93 / setSslTomcat.instruction
Created July 7, 2016 07:20
how to set ssl in tomcat
Update configuration file in Tomcat conf
1. ext.properties
box.file.path - {%TOMCAT_HOME}/conf/BOX (plesae replace your tomcat home)
key.file.path - {%TOMCAT_HOME}/conf/key/ (plesae replace your tomcat home)
2. Update all *-cas.properties
xxxx.web.app.protocol=https (http or https)
xxxx.web.app.host=douglessiu7:8443 (update your localhost name)