Skip to content

Instantly share code, notes, and snippets.

View mungi's full-sized avatar

Mungi mungi

  • SK Holdings
  • Korea
View GitHub Profile
@mungi
mungi / init.sh
Created June 16, 2020 04:53
NBP sample demo
#!/bin/bash
yum -y install httpd php mysql php-mysql
systemctl enable httpd
cd /var/www/html
wget http://211.249.50.207/lab/lab.tgz
tar xvfz lab.tgz
cat phpadd >> /etc/httpd/conf/httpd.conf
chmod 777 /var/www/html -R
systemctl start httpd
@mungi
mungi / terraform-debug-msg
Created July 8, 2019 05:23
terraform-debug-msg
# TF_LOG=DEBUG terraform apply
2019/07/08 14:20:21 [INFO] Terraform version: 0.11.14
2019/07/08 14:20:21 [INFO] Go runtime version: go1.12.4
2019/07/08 14:20:21 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2019/07/08 14:20:21 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2019/07/08 14:20:21 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/07/08 14:20:21 [INFO] CLI command args: []string{"apply"}
2019/07/08 14:20:21 [INFO] command: empty terraform config, returning nil
2019/07/08 14:20:21 [DEBUG] command: no data state file found for backend config
2019/07/08 14:20:21 [DEBUG] New state was assigned lineage "0190fed9-962a-50a4-94ac-cba31838697c"
@mungi
mungi / downflvs.py
Created May 14, 2019 15:55
download some series using rtmpdump
import subprocess
def down_flv():
for i in range(1, 17):
for j in range(2, 7):
filename = "{:02d}_{:02d}".format(i, j)
url = "rtmpdump -i rtmp://rtmp.domain.com:9080/LMS-APP/INST01/service/1005922/FLV/{} -o {}.flv".format(filename, filename)
print(url)
subprocess.call(url, shell=True)
print("Done {}".format(filename))
@mungi
mungi / gist:4ac2a6183c54c2f097ae8a167a5cec90
Created January 14, 2019 09:53
* ibm_compute_bare_metal.monthly_bm1: Error ordering bare metal server:
SoftLayer_Exception_Public: Windows Server 2012 R2 Standard Edition (64 bit) (2-4 Cores), price ID# 222581, has a Cores capacity restriction that does not match the capacity of Dual Intel Xeon Gold 6140 (36 Cores, 2.30 GHz), price ID# 202201.
Please submit prices that are compatible. (HTTP 500)
{Entity:{}
ClusterIdentifier:<nil>
BigDataOrderFlag:<nil>
BillingInformation:<nil>
BillingOrderItemId:<nil>
CancelUrl:<nil>
@mungi
mungi / nginx.conf
Created December 17, 2018 06:50
/etc/nginx/sites-enabled/redmine
# Redmine
upstream redmine {
server 127.0.0.1:8080 fail_timeout=0;
}
## Normal HTTP host
server {
listen 0.0.0.0:80;
listen [::]:80 default_server;
@mungi
mungi / bm_osreload.sh
Last active December 13, 2018 16:43
Baremetal OS Reload
curl -u $SL_USERNAME:$SL_API_KEY -X POST -d '{"parameters": ["FORCE", {"customProvisionScriptUri": "https://raw.githubusercontent.com/mungi/gist/master/pv-cent.sh", "upgradeBios": 1, "sshKeyIds": [887911]}]}' 'https://api.softlayer.com/rest/v3.1/SoftLayer_Hardware_Server/1602553/reloadOperatingSystem.json'
@mungi
mungi / original-ks.cfg
Last active November 2, 2018 07:16
Kickstart builded of Softlayer
original-ks.cfg [16:08:19]
#IMSv3 initiated Kickstart build:
#Configure system language
lang en_US
#Configure language modules and system mouse
#Configure system keyboard
keyboard us
@mungi
mungi / slcli call-api
Last active November 2, 2018 11:09
slcli call-api examples
slcli call-api Account getHardware --offset=0 --limit=20 --mask=id,hostname,tagReferences.tag.name
slcli --format=json call-api Account getVirtualGuests --mask="id,maxCpu,maxMemory,hostname,billingItem[id,orderItem[id,order[id,userRecord[id,username]]]]"
slcli call-api Account getVirtualGuests --mask="id,maxCpu,maxMemory,hostname,billingItem[id,orderItem[id,order[id,userRecord[id,username]]]]"
slcli --format=json call-api Account getHardware --mask="id,processorPhysicalCoreAmount,memoryCapacity,hostname,billingItem[id,orderItem[id,order[id,userRecord[id,username]]]]"
slcli --format json call-api Account getHardware --mask=id,fullyQualifiedDomainName,operatingSystem.passwords.password
slcli call-api Account getHardware --mask="id,processorPhysicalCoreAmount,memoryCapacity,hostname,billingItem[id,orderItem[id,order[id,userRecord[id,username]]]]"
slcli call-api Account getVirtualDedicatedRacks --mask="id,name,metricTrackingObjectId"
# get IPMI connection info
slcli --format raw call-api Account getHardware --ma
@mungi
mungi / vm-20tb.tf
Created July 13, 2018 13:58
VM: 1x8x25, 1Gbps NIC, 20TB outbound
variable "group" {
default = "a"
}
variable "datacenter" {
default = "seo01"
}
variable "vm-type" {
default = "M1_1X8X25"
}
data "ibm_compute_ssh_key" "ssh-key" {
@mungi
mungi / initbm.sh
Created June 26, 2018 12:56
Softlayer Barmeta Init
df -h
blkid
/opt/MegaRAID/storcli/storcli64 /c0 show all|grep -A 36 "VD LIST :"
fdisk
fdisk -l