Skip to content

Instantly share code, notes, and snippets.

Avatar
🚧
WIP

Bayu Aldi Yansyah pyk

🚧
WIP
View GitHub Profile
@pyk
pyk / goprompt.sh
Created May 23, 2014
How to: display Go lang version on Bash prompt
View goprompt.sh
# add this function on your .bashrc file to echoed Go version
function go_version {
version=$(go version)
regex="(go[0-9].[0-9].[0-9])"
if [[ $version =~ $regex ]]; then
echo ${BASH_REMATCH[1]}
fi
}
# and add to your PS1, for example
@pyk
pyk / installing postgresql 9.3.2 on ubuntu 12.04.md
Created Jan 3, 2014
installing postgresql 9.3.2 on ubuntu 12.04 . with error fix: ummet dependencies
View installing postgresql 9.3.2 on ubuntu 12.04.md

installing postgresql 9.3.2 on ubuntu 12.04

follow official guide

$ echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.3 postgresql-contrib-9.3

you should succesfully installing postgresql 9.3.2 on your machine.

@pyk
pyk / EDVR_test_video_without_gt.py
Created Sep 13, 2020
Apply pre-trained EDVR model without the ground truth
View EDVR_test_video_without_gt.py
class VideoTestDatasetWithoutGT(data.Dataset):
"""Video test dataset.
More generally, it supports testing dataset with following structures:
dataroot
├── subfolder1
├── frame000
├── frame001
├── ...
├── subfolder1
├── frame000
@pyk
pyk / Windows 10 Fix docker-credential-desktop not installed or not available in PATH.md
Created Apr 24, 2020
Windows 10 Fix docker-credential-desktop not installed or not available in PATH
View Windows 10 Fix docker-credential-desktop not installed or not available in PATH.md

When try to run AWS Lambda locally on windows:

sam local invoke

I got the following error:

Invoking app.lambda_handler (python3.8)
View elasticsearch-statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: elasticsearch
labels:
service: elasticsearch
spec:
serviceName: es
# NOTE: This is number of nodes that we want to run
# you may update this
View Set-Window.ps1
Function Set-Window {
<#
.SYNOPSIS
Retrieve/Set the window size and coordinates of a process window.
.DESCRIPTION
Retrieve/Set the size (height,width) and coordinates (x,y)
of a process window.
.PARAMETER ProcessName
@pyk
pyk / python-on-windows-10.md
Last active Jan 30, 2020
Setup Python development in Windows 10
View python-on-windows-10.md

Python Setup

Download and install Python 3.8.

Open the folder using VSCode.

Open the VSCode terminal using CTRL + J.

Then create new virtualenv using the following command:

@pyk
pyk / biggestandsmallest.go
Created Apr 12, 2014
find the biggest and smallest number in the given slice or array using go lang
View biggestandsmallest.go
package main
import "fmt"
func main() {
var n, smallest, biggest int
x := []int{
48,96,86,68,
57,82,63,70,
37,34,83,27,
@pyk
pyk / active-record-migration-expert.md
Last active Dec 3, 2019
become active record migration expert (Rails 4.0.2)
View active-record-migration-expert.md

become active record migration expert (Rails 4.0.2)

workflow:

create model

$ rails g model NameOfModel
    invoke  active_record
    create    db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
@pyk
pyk / README.md
Last active Sep 18, 2019
Install Oracle java 8 on debian jessie
View README.md

Run

wget https://gist.githubusercontent.com/pyk/19a619b0763d6de06786/raw/b09ce3a6626484adb5339597dfd391d0db9fe3cb/install-oracle-java-8-on-debian-jessie.sh
sh install-oracle-java-8-on-debian-jessie.sh

See the following blog post

You can’t perform that action at this time.