Skip to content

Instantly share code, notes, and snippets.

View rawinng's full-sized avatar
🎯
Focusing

Rawin Ngamloet rawinng

🎯
Focusing
View GitHub Profile
@rawinng
rawinng / Dockerfile
Created June 26, 2020 01:57
File for special docker request project
FROM centos:8
# Alternative mirror: https://sourceforge.net/projects/openofficeorg.mirror/
# libXmu-1.1.2-2.el7.x86_64 required for libXmu.so.6, freetype-2.4.15-11.el7.x86_64 required for libfreetype.so.6
RUN cd /tmp && \
curl -LO https://archive.apache.org/dist/incubator/ooo/files/stable/3.4.1/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_en-US.tar.gz && \
tar -xzf Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_en-US.tar.gz && \
rm -f Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_en-US.tar.gz && \
yum install -y libXmu.x86_64 freetype.x86_64 && \
@rawinng
rawinng / try-mongo.yaml
Created May 19, 2020 01:19
Make 2 mongo instance on yr local docker-for-windows
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: try-mongo
spec:
serviceName: "mongo"
replicas: 2
selector:
matchLabels:
app: mongo
@rawinng
rawinng / GIT.config
Created September 19, 2019 04:25
Git log configuration for better message output
[log]
date = relative
[format]
pretty = format:%C(Yellow)%h%Creset %Cblue%ad%Creset %Cgreen%ae%Creset %Cred%d%Creset %s
#!/bin/bash
if [ $# -lt 1 ]
then
cat << HELP
dockertags -- list all tags for a Docker image on a remote registry.
EXAMPLE:
- list all tags for ubuntu:
<?xml version="1.0" encoding="utf-8"?>
<!--
LOGBack example
-->
<configuration>
<!-- console appender -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
http://controller:6080/vnc_auto.html?token=3c16709b-8abd-42f6-9ed2-30c4d2bfaa66
package com.augmentis.ayp.crimin.model;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import com.augmentis.ayp.crimin.model.CrimeDbSchema.CrimeTable;
/**
@rawinng
rawinng / Deadlock.java
Created March 30, 2016 04:24
Classic deadlock situation from Java Tutorial Guide
public class Deadlock {
static class Friend {
private final String name;
public Friend(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
public synchronized void bow(Friend bower) {
Thread-0 is waiting for Lock 1
Thread-3 is waiting for Lock 2
Thread-2 is waiting for Lock 1
Thread-5 is waiting for Lock 2
Thread-4 is waiting for Lock 2
Thread-1 is waiting for Lock 1
@rawinng
rawinng / SynchonizationLab.java
Created March 29, 2016 03:54
Synchronization mechanism testing
public class SynchonizationLab implements Runnable {
final private MyLock lock;
SynchonizationLab(MyLock lock) {
this.lock = lock;
}
@Override
public void run() {