Skip to content

Instantly share code, notes, and snippets.

View gopalindians's full-sized avatar
🕶️
.

Gopal Sharma gopalindians

🕶️
.
View GitHub Profile
class ContestantTrader(Trader):
def __init__(self, name, prediction_offness, capital=10000):
super().__init__(name, capital)
self.trades = []
self.total_asset_value = capital
# guess on dividends
self.prediction_offness = prediction_offness
self.dividend_estimate = None
@EhsanCh
EhsanCh / fpm_get_status.php
Created February 19, 2023 10:54
PHP-FPM real-time status page (Single file without the need for web server configuration)
<?php
// Upload to private url or implement authorization...
if (isset($_GET["json"])) {
header("Content-type: application/json");
exit(json_encode( fpm_get_status() ));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
@valorin
valorin / Middleware-CSP.php
Last active February 5, 2024 18:34
CSP Middleware - the simple CSP middleware I use across all of my projects.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\Str;
/**
* Simple Content Security Policy middleware.
@MahbbRah
MahbbRah / Javascript_fetch_request_php_server.md
Last active January 9, 2020 09:30
Making http POST/GET request from React-Native/React/Javascript side (Using Fetch API) to PHP server
// A function that sends http POST request to PHP server by using Javascript Fetch API with async/await :) 
async function POST(url, payload){

    var body = Object.keys(payload).map((key) => {
        return encodeURIComponent(key) + '=' + encodeURIComponent(payload[key]);
    }).join('&');

 let options = {
library chess_board;
import 'dart:async';
import 'package:chess_vectors_flutter/chess_vectors_flutter.dart';
import 'package:flutter/material.dart';
import 'package:chess/chess.dart' as chess;
typedef Null MoveCallback(String moveNotation);
typedef Null CheckMateCallback(String winColor);
@branflake2267
branflake2267 / main.dart
Created March 27, 2018 04:37
Flutter - Passing data to the next page. Used in the youtube video.
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@bladeSk
bladeSk / SQLite-PHP-quickstart.php
Last active April 15, 2024 15:55
SQLite3 PHP Quickstart Tutorial
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
// Errors are emitted as warnings by default, enable proper error handling.
@tylersloeper
tylersloeper / Arrays: Left Rotation in C
Last active April 15, 2020 17:32
Hacker Rank: Arrays: Left Rotation, (in c, c#, php, and javascript)
/**
The challenge:
https://www.hackerrank.com/challenges/ctci-array-left-rotation
**/
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
@linktohack
linktohack / index.php
Created June 20, 2016 07:20
Adminer 4.2.5 loader without password for SQLite
<?php
function adminer_object() {
class AdminerSoftware extends Adminer {
function login($login, $password) {
return true;
}
}
return new AdminerSoftware;
}
include "./adminer-4.2.5.php";