GLab

Go Report Card Coverage Mentioned in Awesome Go Gitpod Ready-to-Code

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching between windows and browser tabs. Work with issues, merge requests, watch running pipelines directly from your CLI among other features.

glab is available for repositories hosted on GitLab.com and self-managed GitLab instances. glab supports multiple authenticated GitLab instances and automatically detects the authenticated hostname from the remotes available in the working Git directory.

command example

Table of contents

Usage

To get started with glab:

  1. Follow the installation instructions appropriate for your operating system.
  2. Authenticate into your instance of GitLab.
  3. Optional. Configure glab further to meet your needs:

You’re ready! Run glab --help to view a list of core commands. Commands follow this pattern:

glab <command> <subcommand> [flags]

Many core commands also have sub-commands. Some examples:

  • List merge requests assigned to you: glab mr list --assignee=@me
  • List review requests for you: glab mr list --reviewer=@me
  • Approve a merge request: glab mr approve 235
  • Create an issue, and add milestone, title, and label: glab issue create -m release-2.0.0 -t "My title here" --label important

Demo

asciicast

Documentation

Read the documentation for usage instructions or check out glab help.

Installation

Download a binary suitable for your OS at the releases page. Other installation methods depend on your operating system.

macOS

  • Homebrew (officially supported)
    • Install with: brew install glab
    • Update with: brew upgrade glab
  • MacPorts:
    • Install with: sudo port install glab
    • Update with: sudo port selfupdate && sudo port upgrade glab
  • Install into usr/bin with a shell script: curl -s "https://gitlab.com/gitlab-org/cli/-/raw/main/scripts/install.sh" | sudo sh

    Before running any install script, review its contents.

Windows

  • WinGet
    • Install with: winget install glab.glab
    • Update with: winget install glab.glab
  • scoop
    • Install with: scoop install glab
    • Update with: scoop update glab
  • Download an EXE installer or the glab.exe binary from the releases page

Linux

Homebrew

Installing from Homebrew is the officially supported installation method for Linux.

  • Install with: brew install glab
  • Update with: brew upgrade glab

Snapcraft (out of date)

To install glab from the Snap Store:

  1. Make sure you have snap installed on your Linux distribution.
  2. Install the package: sudo snap install --edge glab
  3. Grant glab access to SSH keys: sudo snap connect glab:ssh-keys

Download from the Snap Store

Arch Linux

For Arch Linux, glab is available:

Alpine Linux

glab is available on the Alpine Community Repository as glab.

When installing, use --no-cache so no apk update is required:

apk add --no-cache glab
Install a pinned version from edge

To ensure that by default edge is used to get the latest updates. We need the edge repository in /etc/apk/repositories.

Afterwards you can install it with apk add --no-cache glab@edge

We use --no-cache so an apk update is not required.

echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
apk add --no-cache glab@edge
Alpine Linux Docker-way

Use edge directly

FROM alpine:3.13
RUN apk add --no-cache glab

Fetching latest glab version from edge

FROM alpine:3.13
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk add --no-cache glab@edge

Nix/NixOS

Nix (NixOS) users can install from nixpkgs with the command nix-env -iA nixos.glab.

MPR (Debian/Ubuntu)

glab is available inside the makedeb package repository. To install, run the following:

git clone 'https://mpr.makedeb.org/glab'
cd glab/
makedeb -si
Prebuilt-MPR

The above method downloads glab from source and builds it before packaging it into a .deb package. If you don’t want to compile or just want a prebuilt package, you can also install glab from the Prebuilt-MPR:

  1. Set up the Prebuilt-MPR on your system.
  2. Install with the command sudo apt install glab.

Spack

  • To install: spack install glab.
  • To update: spack uninstall glab && spack install glab

Building from source

If a supported binary for your OS is not found at the releases page, you can build from source:

Prerequisites for building from source

  • make
  • Go 1.18+

To build from source:

  1. Run the command go version to verify that Go version 1.18 or later is installed. If go is not installed, follow instructions on the Go website.
  2. Clone this repository: git clone https://gitlab.com/gitlab-org/cli.git glab
  3. Change into the project directory: cd glab
  4. If you have $GOPATH/bin or $GOBIN in your $PATH, run make install to install in $GOPATH/bin).
  5. If you do not have $GOPATH/bin or $GOBIN in your $PATH:
    1. Run make to build the project.
    2. Run export PATH=$PWD/bin:$PATH to update your PATH with the newly compiled project.
  6. Run glab version to confirm that it worked.

Authentication

To authenticate your installation of glab:

  1. Get a GitLab personal access token with at least the api and write_repository scopes. Use the method appropriate for your instance:
    • For GitLab.com, create one at the Personal access tokens page.
    • For self-managed instances, visit https://gitlab.example.com/-/profile/personal_access_tokens, modifying gitlab.example.com to match the domain name of your instance.
  2. Start interactive setup: glab auth login
  3. Authenticate with the method appropriate for your GitLab instance:
    • For GitLab SaaS, authenticate against gitlab.com by reading the token from a file: glab auth login --stdin < myaccesstoken.txt
    • For self-managed instances, authenticate by reading from a file: glab auth login --hostname salsa.debian.org --stdin < myaccesstoken.txt
    • Authenticate with token and hostname: glab auth login --hostname gitlab.example.org --token xxxxx Not recommended for shared environments.

Configuration

By default, glab follows the XDG Base Directory Spec. Configure it globally, locally, or per-host:

  • Globally: run glab config set --global editor vim.
    • The global configuration file is available at ~/.config/glab-cli.
    • To override this location, set the GLAB_CONFIG_DIR environment variable.
  • The current directory: run glab config set editor vim in any folder in a Git repository.
    • The local configuration file is available at .git/glab-cli in the current working Git directory.
  • Per host: run glab config set editor vim --host gitlab.example.org, changing the --host parameter to meet your needs.
    • Per-host configuration info is always stored in the global configuration file, with or without the global flag.

Environment variables

  • GITLAB_TOKEN: an authentication token for API requests. Setting this avoids being prompted to authenticate and overrides any previously stored credentials. Can be set in the config with glab config set token xxxxxx
  • GITLAB_URI or GITLAB_HOST: specify the URL of the GitLab server if self-managed (eg: https://gitlab.example.com). Default is https://gitlab.com.
  • GITLAB_API_HOST: specify the host where the API endpoint is found. Useful when there are separate (sub)domains or hosts for Git and the API endpoint: defaults to the hostname found in the Git URL
  • GITLAB_REPO: Default GitLab repository used for commands accepting the --repo option. Only used if no --repo option is given.
  • GITLAB_GROUP: Default GitLab group used for listing merge requests, issues and variables. Only used if no --group option is given.
  • REMOTE_ALIAS or GIT_REMOTE_URL_VAR: git remote variable or alias that contains the GitLab URL. Can be set in the config with glab config set remote_alias origin
  • VISUAL, EDITOR (in order of precedence): the editor tool to use for authoring text. Can be set in the config with glab config set editor vim
  • BROWSER: the web browser to use for opening links. Can be set in the configuration with glab config set browser mybrowser
  • GLAMOUR_STYLE: environment variable to set your desired Markdown renderer style Available options are (dark|light|notty) or set a custom style
  • NO_COLOR: set to any value to avoid printing ANSI escape sequences for color output.
  • FORCE_HYPERLINKS: set to 1 to force hyperlinks to be output, even when not outputting to a TTY

stage: Create group: Code Review info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments —

GitLab CLI - glab

GLab is an open source GitLab CLI tool. It brings GitLab to your terminal: next to where you are already working with Git and your code, without switching between windows and browser tabs.

  • Work with issues.
  • Work with merge requests.
  • Watch running pipelines directly from your CLI.

command example

The GitLab CLI uses commands structured like glab <command> <subcommand> [flags] to perform many of the actions you normally do from the GitLab user interface:

# Sign in
glab auth login --stdin < token.txt

# View a list of issues
glab issue list

# Create merge request for issue 123
glab mr for 123

# Check out the branch for merge request 243
glab mr checkout 243

# Watch the pipeline in progress
glab pipeline ci view

# View, approve, and merge the merge request
glab mr view
glab mr approve
glab mr merge

Core commands

  • glab alias
  • glab api
  • glab auth
  • glab ci
  • glab issue
  • glab label
  • glab mr
  • glab project
  • glab release
  • glab snippet
  • glab ssh-key
  • glab user
  • glab variable

Install the CLI

Installation instructions are available in the GLab README.

Authenticate with GitLab

To authenticate with your GitLab account, run glab auth login. glab respects tokens set using GITLAB_TOKEN.

Report issues

Open an issue in the gitlab-org/cli repository to send us feedback.

Clone With Gitlab Self Hosted (PoC)

  • glab auth login
  • select self hosted
  • using https method and your token access
  • use the command below
 
GITLAB_HOST=GITLAB_SELF_HOSTED glab repo clone groupname/path/project_name
GITLAB_HOST=GITLAB_SELF_HOSTED glab repo clone yourgitlabname/project_name
- Clone by group subdir with namespace
GITLAB_HOST=GITLAB_SELF_HOSTED glab repo clone -g groupname/subdir -paginate
- Clone all by group name with namespace   
GITLAB_HOST=GITLAB_SELF_HOSTED glab repo clone -g groupname -p
- Cloner all and subdir by group name with namespace 
GITLAB_HOST=GITLAB_SELF_HOSTED glab repo clone -g groupname/subdir/pathname -p

Refferences :

  • Install: https://gitlab.com/gitlab-org/cli/#installation
  • CLI : https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/repo/clone.md
  • Demo : https://asciinema.org/a/368622

Membuat environment container mysql-server yang fleksibel dan dinamis

Motivasi

Untuk memudahkan dalam mengelola environment yang praktis dan apakah aplikasi dapat dijalankan dengan versi MySQL yang berbeda, disini kita akan membuat versi mysql yang dinamis dan praktis yang bisa kita pilih sesuai versi MySQL.

Saya membuatnya dengan meracik docker-compose untuk mempermudah pengujian apakah aplikasi dapat dimulai dengan versi yang berbeda.

Yang Disupport MySQL version

  • MySQL v5.5
  • MySQL v5.6
  • MySQL v5.7
  • MySQL v8.0
  • mariadb v10.0
  • mariadb v10.1
  • mariadb v10.2
  • mariadb v10.3

Penggunaan

Install docker

https://docs.docker.com/engine/install

Install mysql-client

tidak butuh untuk menginstall mysql client .

saat memanggil connect-xxx.sh, mysql yang dipasang di container akan dicek dan dijalankan secara lokal .

Clone this repository

 
git clone https://github.com/danigunawan/docker-compose-all-mysql-versions.git

Jalankan mysql docker containers

docker-compose up -d

Hubungkan mysql-server lainnya pada docker container

./connect-mysql-5-5.sh
./connect-mysql-5-6.sh
./connect-mysql-5-6.sh
./connect-mysql-8-0.sh
./connect-mariadb-10-0.sh
./connect-mariadb-10-1.sh
./connect-mariadb-10-2.sh
./connect-mariadb-10-3.sh

Tunggu startup MySQL selesai sebelum menghubungkan.

Optional

Customize mysql client settings

vi ./my.cnf

Konfigurasikan pengaturan selain port yang sama.

Customize mysql server settings

vi ./mysql5.5/conf.d/my.cnf
vi ./mysql5.6/conf.d/my.cnf
vi ./mysql5.7/conf.d/my.cnf
vi ./mysql8.0/conf.d/my.cnf
vi ./mariadb10.0/conf.d/my.cnf
vi ./mariadb10.1/conf.d/my.cnf
vi ./mariadb10.2/conf.d/my.cnf
vi ./mariadb10.3/conf.d/my.cnf

Customize default schema, user, password

Jika Anda ingin mengubah skema DB, nama pengguna, kata sandi, atau kata sandi root, edit .env.

DB_DATABASE=work
DB_USER=worker
DB_PASSWORD=worker
DB_ROOT_PASSWORD=root

Remove logs

Jika Anda ingin menghapus general.log dan error.log dan slow-query.log, jalankan clear_logs.sh .

Customize init scripts

https://hub.docker.com/_/mysql/#initializing-a-fresh-instance

Execution order at startup

  1. ./common/initdb.d/common-init.(sh|sql) (dieksekusi secara umum untuk semua kontainer)
  2. ./(mysql|mariadb)X.X/initdb.d/xxx.(sh|sql) (dieksekusi untuk setiap container)

Dengan menyesuaikan ini, data awal dapat diisi saat startup.

Git Repository : LINK

Wajib bagi kamu yang ingin terjun ke dunia data science. ! Kita mulai dari data science, data science itu dipecah menjadi 3 bidang yang besar yaitu :

  • Analitik
  • Modeling
  • Testing

Namun seiring berkembangnya teknologi dan implementasi dibidang Data Science bermunculan bidang-bidang yang relevan dengan implementasi data science pada umumnya seperti :

  • Operational
  • Researcher
  • Security

Mari kita lihat dari flow pekerjaannya bagaimana kita lihat aliran data nya bagaimana sebagai berikut :

1. Analitik

dibidang analitik terdapat role-role yang bertugas dan bertanggung jawab atas data analitik sebagai berikut :

  • Role Business Analyst

Bisnis analyst mencari kebutuhan bisnis itu apa (needsnya) setelah menemukan kebutuhan bisnisnya akan disampaikan ke data analyst requirement-requirement nya apa saja.

  • Data Analyst

Data Analyst bertugas mencari tahu data apa yang dibutuhkan untuk kebutuhan tadi yang sudah dicari oleh bisnis analyst. jika sudah terdapat data warehouse ditempat kebutuhan tersebut data analyst akan mencari sesuai kebutuhan tadi menentukan data mana yang dibutuhkan untuk kebutuhan yang disampaikan oleh bisnis analyst. data analyst juga concern terhadap reporting dan presentasi menyampaikan apa yang data analyst temukan, misalkan menemukan dari data yang kita miliki. jika data nya tidak dimiliki maka data analyst akan menyampaikan dan perlu mengumupulkan data tertentu yang dibutuhkan. Data analyst pun memanage datanya sehingga ada yang namanya roles yakni Data Architect.

  • Data Architect

Data Architect bertugas membuat blueprint aliran data mulai dari yang RAW sampai disimpan ke Database/Warehouse. Blueprint ini secara teknisnya akan dikerjakan oleh Data Engineer sehingga lebih detail dikerjakan oleh Data Engineer yang biasa disebut yaitu Data Pipeline.

  • Data Engineer

Data Engineer bertugas membuat Blueprint aliran data atau data pipeline sehingga mudah diakses dan ditarik datanya oleh Data Analyst, Pipeline tersebut meliputi seperti Data Cleaning, Data Transformation atau yang biasa kita kenal ETL (Extract, Transform dan Load). Data Warehouse dipakai tidak hanya oleh Data Analyst akan tetapi ada tim-tim lain misalkan tim A, B dan C sehingga kita harus memanage juga bahwa tim A boleh mengakses data apa saja, tim B data apa saja maupun tim C dan itu akan dimanage oleh yang namanya Database Administrator

  • Database Admin

Database administrator bertugas dan fokus memberikan akses atau roles sebuah data, selain itu database admin akan fokus ke blueprint terutama ke bagian proteksi data / keamanan data (Data Security) jadi akses sebuah database perlu safety dan aman, database admin pun bertugas untuk membackup data

Jadi pada bagian Analitik ini fokusnya lebih ke “APA” needsnya kebutuhan bisnis kita, apa informasi yang bisa kita dapatkan dari data kita jadi Analitik ini bentuk nya lebih ke reporting.

Ketika kita sudah mendapatkan insight next stepnya adalah selain reporting / insight kita ingin melakukan Prediction dan jika ingin membutuhkan Prediction kita membutuhkan yang namanya model matematik, model yang dimana bisa melakukan sebuah Prediksi sehingga setelah bidang analitik ini ada fase Modeling.

2. Modeling

  • Data Scientist

Data analyst ini merupakan Data Analyst yang sudah memiliki pengalaman dan berkembang menjadi Data Scientist sehingga fokusnya jadi berbeda yakni dibidang permodelan, fokusnya melakukan Prediksi “In The Future” mau prediksi apa sesuai dengan kebutuhan bisnis, namun terkadang Role Data scientists ini datang beragam dari disiplin ilmu seperti statistika, matematika, teknik sampai dengan bisnis sehingga trend kedepan data scientists ini menjadi roles yang diminati karena begitu luas implementasinya.

  • ML Engineer
  • AI Engineer

3. Testing

4. Research

  • ML Researcher
  • AI Researcher

5. Operational

  • MLOps
  • AIOps

6. Security

  • MLSecOps
  • AISecOps

Soon

kalau anak 90 an penggemar film cemen atau kartun pasti kenal dengan film saint saiya dan film super saiya (Dragon Ball), dari alur ceritanya mereka itu sama-sama ingin jadi manusia super, kalau di film dragon ball goku punya level super saiya dengan tingkatan nya dari 1,2,3,4 begitupun saint saiya sampai menjadi saiya gold. jadi disini mahu berbagi saja bagaimana ilmu kita bisa bermanfaat, semakin bermanfaat pastinya semakin berkah kayak goku aja bisa saling menolong, semakin kuat level goku pastinya semakin sulit melawan musuhnya. Jadi cerita cemen diatas hanya sedikit refreshing biar ga terlalu dalam bahas judulnya yak wkwkw…

okay dibawah ini kumpulan soal-soal hackerank saya simpan dalam note buat catatan saja, karena saya sudah bosan menyimpan catatan dilaptop dan biasa nulis di notion, mulai sekarang saya lebih senang sepertinya menyimpan catatan diblog mungkin bisa bermanfaat untuk pribadi, teman-teman sebaya senusa, sebangsa setanah air.. beta :D

Berikut Kumpulan Soal-Soal Hacker Rank Data Science :

  • Q1 Database Question 4 languages allowed: mysql, oracle, tsql, db2

    List Customer and Product Without Sale : LINK

  • Q2 Coding Question 2 languages allowed: python, python3

    Python : List Of Even Integers (Pythoniast pastinya bisa explorasi)

  • Q3 Data Science Question Jupyter Notebook

    Analyze Loan Eligibility : LINK

  • Q4 Data Science Question

    Predict Loan Default : LINK

  • Q5 Backend Question PySpark: Healthcare Data Cleaning : LINK