Skip to content

Instantly share code, notes, and snippets.

View madaarya's full-sized avatar
💻
working for good

Mada Aryakusumah madaarya

💻
working for good
  • Indonesia
View GitHub Profile
@madaarya
madaarya / install_elasticsearch_ubuntu_wsl2.sh
Created November 23, 2021 04:08
Step by step Install elasticsearch on wsl2 + ubuntu
// elasticsearch version 7
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.5.2-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.5.2-linux-x86_64.tar.gz.sha512
shasum -a 512 -c elasticsearch-oss-7.5.2-linux-x86_64.tar.gz.sha512
tar -xzf elasticsearch-oss-7.5.2-linux-x86_64.tar.gz
cd elasticsearch-oss-7.5.2/
echo 'export ES_HOME="$HOME/elasticsearch-7.5.2/"' >> ~/.bashrc
echo 'export PATH="$ES_HOME/bin:$PATH"' >> ~/.bashrc
exec $SHELL
@madaarya
madaarya / Lookup_On_Request_Booking.xml
Created November 10, 2020 22:55
Lookup On Request Booking - Bonotel
<- "POST /bonotelapps/bonotel/reservation/LookupReservation.do HTTP/1.1\r\nContent-Type: application/xml; charset=utf-8\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: xmltest.bonotel.com\r\nContent-Length: 273\r\n\r\n"
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lookupReservationRequest timestamp=\"20201111T05:52:44\">\n <control>\n <userName>PleasureVTest_xml</userName>\n <passWord>dY35D5v4UMhjUv</passWord>\n </control>\n <referenceNo>R601991820X</referenceNo>\n</lookupReservationRequest>\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Tue, 10 Nov 2020 22:52:44 GMT\r\n"
-> "Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.4.16 mod_jk/1.2.42\r\n"
-> "X-Powered-By: Servlet 2.4; JBoss-4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231054)/Tomcat-5.5\r\n"
-> "Vary: Accept-Encoding,User-Agent\r\n"
-> "Content-Type: text/xml;charset=utf-8\r\n"
-> "Content-Length: 637\r\n"
-> "Connection: close\r\n"
@madaarya
madaarya / single_hotel.xml
Created November 10, 2020 22:37
Single Hotel Search
<- "POST /bonotelapps/bonotel/reservation/GetAvailability.do HTTP/1.1\r\nContent-Type: application/xml; charset=utf-8\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: xmltest.bonotel.com\r\nContent-Length: 672\r\n\r\n"
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<availabilityRequest cancelpolicy=\"Y\" hotelfees=\"Y\">\n <control>\n <userName>PleasureVTest_xml</userName>\n <passWord>dY35D5v4UMhjUv</passWord>\n </control>\n <checkIn>12-Nov-2020</checkIn>\n <checkOut>13-Nov-2020</checkOut>\n <noOfRooms>1</noOfRooms>\n <noOfNights>1</noOfNights>\n <country>US</country>\n <city>CY191</city>\n <hotelCodes>\n <hotelCode>7967</hotelCode>\n </hotelCodes>\n <roomsInformation>\n <roomInfo>\n <roomTypeId>0</roomTypeId>\n <bedTypeId>0</bedTypeId>\n <adultsNum>1</adultsNum>\n <childNum>0</childNum>\n <childAges/>\n </roomInfo>\n </roomsInformation>\n</availabilityRequest>\n"
-> "HTTP/1.1 200 2
@madaarya
madaarya / city_search.xml
Created November 10, 2020 22:34
City Search - Bonotel
opening connection to xmltest.bonotel.com:80...
opened
<- "POST /bonotelapps/bonotel/reservation/GetAvailability.do HTTP/1.1\r\nContent-Type: application/xml; charset=utf-8\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: xmltest.bonotel.com\r\nContent-Length: 657\r\n\r\n"
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<availabilityRequest cancelpolicy=\"Y\" hotelfees=\"Y\">\n <control>\n <userName>PleasureVTest_xml</userName>\n <passWord>dY35D5v4UMhjUv</passWord>\n </control>\n <checkIn>12-Nov-2020</checkIn>\n <checkOut>13-Nov-2020</checkOut>\n <noOfRooms>1</noOfRooms>\n <noOfNights>1</noOfNights>\n <country>US</country>\n <city>CY191</city>\n <hotelCodes>\n <hotelCode/>\n </hotelCodes>\n <roomsInformation>\n <roomInfo>\n <roomTypeId>0</roomTypeId>\n <bedTypeId>0</bedTypeId>\n <adultsNum>1</adultsNum>\n <childNum>0</childNum>\n <childAges/>\n </roomInfo>\n </roomsInformation>\n</av
@madaarya
madaarya / freelance_start
Last active May 23, 2020 05:25
Shell script for change ssh key
#!/bin/bash
set -x
git config --global user.email lokerm*d*@gm*il.com;
git config --list
rm .ssh/id_rsa*
cp .ssh/madha/id_rsa* ~/.ssh/
cat .ssh/id_rsa.pub
class Report < ApplicationRecord
has_ancestry
serialize :account_type_data, Array
serialize :total_calculation, Array
serialize :meta_data, JSON
serialize :outputs, JSON
serialize :items, Array
mount_uploader :attachment, PaymentReportUploader
validates :attachment, presence: true
before_create :set_default_value
require 'time'
require 'csv'
require 'date'
require './services/lib/motes'
require "#{Dir.pwd}/services/lib/udp_log"
class PayloadDetail
def self.generate(data, port)
@madaarya
madaarya / table_info_with_size.sql
Created July 27, 2017 03:56
Get list of table from a database
SELECT
TABLE_NAME AS `Table`,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = "salonist"
ORDER BY
(DATA_LENGTH + INDEX_LENGTH)
DESC;
@madaarya
madaarya / post_dropzone.js
Created December 11, 2016 15:00
dropzone example when use normal form submit
//= require dropzone
$(document).on("ready", function(){
Dropzone.autoDiscover = false;
new Dropzone('#postCreateForm',{
paramName: "post_images_attributes",
autoProcessQueue: false,
uploadMultiple: true,
clickable: '.js-input-create-dropzone',
maxFiles: 10,
<!DOCTYPE html>
<html lang="en">
<head>
<noscript>
<meta http-equiv="refresh" content="2;url=http://www.enable-javascript.com" />
</noscript>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<title>Eproposal</title><meta content="authenticity_token" name="csrf-param" />