Skip to content

Instantly share code, notes, and snippets.

View c18s's full-sized avatar
🏠
Working from home

Chagridsada Boonthus c18s

🏠
Working from home
View GitHub Profile
@c18s
c18s / vscode.setting.json
Created August 30, 2019 07:41
vscode setting json file
{
"workbench.startupEditor": "newUntitledFile",
"workbench.colorTheme": "One Dark Pro",
"editor.fontFamily": "Menlo, Monaco, 'Courier New', monospace, 'Meslo LG S for Powerline'",
"files.trimTrailingWhitespace": true,
"yaml.format.singleQuote": true,
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.quickSuggestions": {
@c18s
c18s / sshd.Dockerfile
Created July 17, 2019 11:45
SSHD Dockerfile
FROM alpine:edge
RUN apk add --no-cache openssh sudo
RUN ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
RUN adduser -D -s /bin/ash -u 1000 system && \
echo "system ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers && \
sed -i -r 's/^system:!:/system:x:/' /etc/shadow && \
echo "Hello Developers!" > /etc/motd
RUN sed -i \
-e 's/^AllowTcpForwarding.*$/AllowTcpForwarding yes/' \
-e 's/^.*#PermitRootLogin.*$/PermitRootLogin no/' \
@c18s
c18s / ApplePressAndHoldEnabled.sh
Created November 6, 2018 07:18
ApplePressAndHoldEnabled
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
@c18s
c18s / gitlab-runner-helm-configmap.yaml
Created October 29, 2018 19:35
Gitlab Runner on K8S config map with helm
/entrypoint register --non-interactive --description "builder.services.im" \
{{- range .Values.runners.imagePullSecrets }}
--kubernetes-image-pull-secrets {{ . | quote }} \
{{- end }}
CONFIG_PATH=/home/gitlab-runner/.gitlab-runner/config.toml
echo ' [[runners.kubernetes.volumes.host_path]]' >>$CONFIG_PATH
echo ' name = "docker"' >>$CONFIG_PATH
echo ' mount_path = "/var/run/docker.sock"' >>$CONFIG_PATH
echo ' read_only = false' >>$CONFIG_PATH
@c18s
c18s / git-log.sh
Created June 28, 2018 17:38
A better git log
# make an alias
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# run
git lg
git lg -p
@c18s
c18s / docker-compose-acme.yml
Last active April 24, 2019 08:54
acme.sh docker compose
## --- Docker Compose ---
version: '2'
services:
acme.sh:
image: neilpang/acme.sh container_name: acme.sh
restart: always
environment:
- Namecom_Username=
- Namecom_Token=
volumes:
@c18s
c18s / debian-environment.sh
Last active March 2, 2024 06:09
Debian environment packages
#!/bin/sh
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get -y dist-upgrade
apt-get -y purge rpcbind ntp
apt-get -y install curl mosh htop sudo git make tmux net-tools wget nload ntpdate iptraf-ng mtr \
iftop w3m vim locales tcpdump unzip bc hping3 vnstat bwm-ng bmon xz-utils python3-pip \
dnsutils nethogs iperf3 acl tree ca-certificates gnupg
apt-get -y autoremove && apt-get -y autoclean
update-alternatives --set editor /usr/bin/vim.basic
timedatectl set-timezone Asia/Bangkok 2>/dev/null