Skip to content

Instantly share code, notes, and snippets.

View chaeya's full-sized avatar
😀

Kevin Kim chaeya

😀
View GitHub Profile
@chaeya
chaeya / xrandr-set.sh
Created November 29, 2022 08:26
vivobook screen resolution control at office
#!/bin/bash
screen_count=$(xrandr -q |grep -w "connected" | wc -l)
if [ $screen_count = "2" ]; then
xrandr --output eDP-1 --mode 2880x1800 --scale 0.5x0.5 --pos 0x0 --rotate normal --output DP-3 --primary --mode 3440x1440 --scale 1x1 --pos 2880x0 --rotate normal
else
xrandr --output eDP-1 --mode 2880x1800 --scale 1.2x1.2 --pos 0x0 --rotate normal --primary
fi
@chaeya
chaeya / v6.0.10-hamonikr1.patch
Created November 29, 2022 05:10
linux kernel v6.0.10 ASUS VivoBook S5402ZA keyboard disable patch
diff -crB a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
*** a/drivers/gpio/gpiolib-acpi.c 2022-11-28 20:03:26.825171988 +0900
--- b/drivers/gpio/gpiolib-acpi.c 2022-11-28 20:18:28.049389594 +0900
***************
*** 1590,1595 ****
--- 1590,1609 ----
.ignore_interrupt = "AMDI0030:00@18",
},
},
+ {
--- a/drivers/acpi/resource.c 2022-10-26 19:53:32.000000000 +0900
+++ b/drivers/acpi/resource.c 2022-10-27 21:42:53.732581293 +0900
@@ -399,6 +399,31 @@
{ }
};
+static const struct dmi_system_id asus_laptop[] = {
+ {
+ .ident = "Asus Vivobook K3402ZA",
+ .matches = {
#!/bin/bash
sudo apt install -y vim git xclip
[ ! -f ~/.ssh/id_ed25519.pub ] && exec ssh-keygen -t ed25519 -C "chaeya@gmail.com"
cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard
cat ~/.ssh/id_ed25519.pub
xdg-open "https://github.com/settings/keys" &
[ ! -d ./dev-settings ] && git clone git@github.com:chaeya/dev-settings.git
dev-settings/dev-setting.sh
@chaeya
chaeya / install.sh
Created August 12, 2020 08:12 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@chaeya
chaeya / rotate_desktop.sh
Created April 18, 2020 07:14 — forked from mildmojo/rotate_desktop.sh
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
@chaeya
chaeya / post_install.sh
Created October 15, 2018 08:18 — forked from waleedahmad/post_install.sh
Ubuntu post installation script for installing software of your choice.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
else
#Update and Upgrade
echo "Updating and Upgrading"
apt-get update && sudo apt-get upgrade -y
@chaeya
chaeya / setenv.sh
Created November 28, 2017 04:21
java environment setting
#
# Cutom Environment Variables for Tomcat
#
############################################
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=${JAVA_HOME}/bin:${PATH}
############################################
#
# JAVA_OPTS
@chaeya
chaeya / autopgsqlbackup
Created November 6, 2017 22:32 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@chaeya
chaeya / FileDownloadController.java
Last active October 30, 2017 11:25
Image Download Source
package com.invesume.portal.common.controller;
import java.io.File;
import java.io.FileInputStream;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.io.IOUtils;