Skip to content

Instantly share code, notes, and snippets.

@0x4D31
0x4D31 / libssh_server_fingerprints.md
Last active February 3, 2024 18:51
[libssh server fingerprints] An analysis of Censys Public Scan 20180807 (only port 22) to estimate the number of servers {potentially} vulnerable to the recent Libssh bug #libssh #hassh
@xdavidhu
xdavidhu / converter.sh
Last active June 4, 2024 08:51
Converter.sh, a bash script to convert domain lists to resolved IP lists without duplicates
#!/bin/bash
# Converter.sh by @xdavidhu
# This is a script inspired by the Bug Hunter's Methodology 3 by @Jhaddix
# With this script, you can convert domain lists to resolved IP lists without duplicates.
# Usage: ./converter.sh [domain-list-file] [output-file]
echo -e "[+] Converter.sh by @xdavidhu\n"
if [ -z "$1" ] || [ -z "$2" ]; then
echo "[!] Usage: ./converter.sh [domain-list-file] [output-file]"
exit 1
@thomasdarimont
thomasdarimont / App.java
Last active October 27, 2023 07:44
Secure REST API Example with Spring Security, Spring Session, Spring Boot
package demo;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
#!/usr/bin/env python
# https://www.reddit.com/r/netsec/comments/4a93eo/analysis_of_vm_escape_by_using_lua_script/d0zcsgl
import sys
import time
import getopt
import socket
'''
Gives the hexadecimal representation of "command"
import android.annotation.TargetApi;
import android.content.Context;
import android.text.Layout;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
/**
@ongakuer
ongakuer / MathUtil.java
Last active January 16, 2019 15:14
Smooth LinearGradient
public class MathUtil {
public static float constrain(float min, float max, float v) {
return Math.max(min, Math.min(max, v));
}
public static float interpolate(float x1, float x2, float f) {
return x1 + (x2 - x1) * f;
}
public static float uninterpolate(float x1, float x2, float v) {
@ArthurSav
ArthurSav / WrapGridLayoutManager.java
Created September 11, 2015 14:45
GridLayoutManager with working wrap_content.
package com.inperson.android.utils.leastview;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
public class WrappableGridLayoutManager extends GridLayoutManager {
@sensen
sensen / LollipopBitmapMemoryCacheParamsSupplier.java
Created September 4, 2015 03:33
Fresco's custom BitmapMemoryCacheParamsSupplier for Lollipop devices
public class LollipopBitmapMemoryCacheParamsSupplier implements Supplier<MemoryCacheParams> {
private ActivityManager activityManager;
public LollipopBitmapMemoryCacheParamsSupplier(ActivityManager activityManager) {
this.activityManager = activityManager;
}
@Override
public MemoryCacheParams get() {
@ftvs
ftvs / PhonecallReceiver.java
Last active October 11, 2023 10:05
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@imran0101
imran0101 / EndlessRecyclerOnScrollListener.java
Last active February 22, 2022 12:50
RecyclerView position helper to get first and last visible positions
/**
* Custom Scroll listener for RecyclerView.
* Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e
*/
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = "EndlessScrollListener";
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.