Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
##
# File:
# nginx_modsite
# Description:
# Provides a basic script to automate enabling and disabling websites found
# in the default configuration directories:
# /etc/nginx/sites-available and /etc/nginx/sites-enabled
# For easy access to this script, copy it into the directory:
@Maysora
Maysora / mac_arrow_keys_caps.json
Last active April 10, 2023 14:09
Karabiner complex mod for arrow keys on MacOS
{
"title": "Caps Lock to arrow keys",
"rules": [
{
"description": "Caps Lock as modifier (required, pick one)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
@Maysora
Maysora / .bash_profile
Last active August 28, 2023 03:03
my .bash_profile file
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# docker
alias dc='docker-compose'
alias dw='dc exec web'
alias dt='dc exec -e "RAILS_ENV=test" web'
alias dx='dw bundle exec'
alias dxr='dx rails'
@Maysora
Maysora / f660_pass
Last active November 12, 2017 10:31
bash script to fetch ZTE F660 admin password
#!/bin/bash
#
# Simple script to fetch F660 admin password which occasionally changed by telkom
#
# OSX 10.13 (High Sierra) no longer have telnet, workaround: https://forums.developer.apple.com/thread/91472
#
# usage:
# $ ./f660_pass 192.168.1.1
#
ip=${1:-"192.168.1.1"}
@Maysora
Maysora / Dockerfile
Last active April 13, 2017 17:07
Rails docker
FROM ruby:2.4.1
RUN apt-get update -qq && apt-get install -y build-essential
# install nodejs : https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - && apt-get install -y nodejs
# for postgresql
RUN apt-get install -y libpq-dev
@Maysora
Maysora / BeautifyRuby.sublime-settings
Last active March 31, 2023 04:41
SublimeText4 OSX Setting
{
"save_on_beautify": false,
"tab_size": 2,
"ruby": "~/.rbenv/shims/ruby",
}
@Maysora
Maysora / cname_check.rb
Created December 5, 2016 09:06
Ruby DNS CNAME check
require 'resolv'
url = 'mail.bocistudio.com'
begin
r = Resolv::DNS.open do |dns|
dns.getresource(url, Resolv::DNS::Resource::IN::CNAME)
end
r.name.to_s # => return alias domain
rescue Resolv::ResolvError => e
# handle error
@Maysora
Maysora / hosts
Last active May 22, 2021 12:38
hosts file for blocking malicious script injection
# Telkom Speedy / Indihome
0.0.0.0 internet-positif.org
0.0.0.0 stat01.u-ad.info
0.0.0.0 cfs.u-ad.info
0.0.0.0 u-ad.info
0.0.0.0 cfs.uzone.id
0.0.0.0 cfs1.uzone.id
0.0.0.0 cfs2.uzone.id
0.0.0.0 kendedes.uzone.id
0.0.0.0 mercusuar.uzone.id