Skip to content

Instantly share code, notes, and snippets.

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

Naoya Nakazawa n0ts

🏠
Working from home
  • Freelancer
  • Tokyo, Japan
  • X @n0ts
View GitHub Profile
{
"Comment": "string",
"Changes": [
{
"Action": "CREATE"|"DELETE",
"ResourceRecordSet": {
"Name": "string",
"Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA",
"SetIdentifier": "string",
"Weight": long,
@n0ts
n0ts / r53_batch_sample.json
Last active December 23, 2015 19:19
Route53 Batch JSON
A Record
{
"Changes": [
{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "<FQDN>",
"Type": "A",
"TTL": 300,
"ResourceRecords": [
#include <mysql.h>
#include <stdio.h>
#include <stdlib.h>
main() {
MYSQL *conn;
MYSQL_RES *res;
MYSQL_ROW row;
char *server = "localhost";
@n0ts
n0ts / setterm
Last active January 4, 2016 10:59
/etc/init.d/setterm
#!/bin/sh
### BEGIN INIT INFO
# Provides: setterm
# Required-Start:
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: disable console blanking
# Description: ref.
@n0ts
n0ts / disable_service_centos5.sh
Last active January 4, 2016 10:59
Disable Service for CentOS 5 on VM
while read SERVICE
do
service $SERVICE stop
chkconfig $SERVICE off
done << EOL
acpid
auditd
autofs
bluetooth
firstboot
@n0ts
n0ts / install-vmware-tools.sh
Last active December 6, 2019 01:50
Install vmware tools
#!bin/bash
mkdir /mnt/cdrom
mount -r /dev/cdrom /mnt/cdrom
cd /tmp
tar zxf /mnt/cdrom/VMwareTools-*.tar.gz
./vmware-tools-distrib/vmware-install.pl --default
@n0ts
n0ts / disable_service_centos6.sh
Last active January 4, 2016 13:58
Disable Service for CentOS 6 on VM
while read SERVICE
do
service $SERVICE stop
chkconfig $SERVICE off
done << EOL
ip6tables
iptables
netfs
EOL
@n0ts
n0ts / gennerate_passwd.py
Created February 7, 2014 07:22
Generate password
from crypt import crypt
from random import choice
import string
import sys
salt_pop = string.letters + string.digits + '.' + '/'
salt = ''
for i in range(8):
salt = salt + choice(salt_pop)
@n0ts
n0ts / get_chef_packages.rb
Created February 10, 2014 12:39
Get Chef Packages
#
# get_packages.rb <el5|el6|deb>
#
require 'net/http'
require 'rexml/document'
case ARGV[0]
when 'el5', 'el6', 'deb'
package = ARGV[0]
else
num calls time self name
-----------------------------------------------------------------------------------
1) 1 205.59 205.59 71.91% 205.59 205.59 71.91% rbenv
2) 4 40.86 10.21 14.29% 40.86 10.21 14.29% compaudit
3) 2 79.44 39.72 27.79% 38.58 19.29 13.50% compinit
4) 1 0.29 0.29 0.10% 0.29 0.29 0.10% bashcompinit
5) 2 0.22 0.11 0.08% 0.22 0.11 0.08% compdef
6) 1 0.21 0.21 0.07% 0.21 0.21 0.07% is-at-least
7) 1 0.16 0.16 0.05% 0.07 0.07 0.03% complete
8) 1 0.05 0.05 0.02% 0.05 0.05 0.02% exists