Skip to content

Instantly share code, notes, and snippets.

View ijat's full-sized avatar
🏠
Working from home

Ijat ijat

🏠
Working from home
View GitHub Profile
@ijat
ijat / conf.xml
Created January 23, 2021 08:29 — forked from Anime4000/conf.xml
Maxis TP-Link Archer C5v
<?xml version="1.0"?>
<DslCpeConfig>
<InternetGatewayDevice>
<DeviceSummary val="InternetGatewayDevice:1.1[](Baseline:1, EthernetLAN:1)" />
<LANDeviceNumberOfEntries val=2 />
<WANDeviceNumberOfEntries val=3 />
<DeviceInfo>
<ManufacturerOUI val=F8D111 />
<SerialNumber val=0000000000000 />
<HardwareVersion val="Archer C5v v1 00000000" />
@ijat
ijat / StringCompressionExtension.cs
Created December 21, 2020 15:36
Dotnet string / text compression and decompression extension
public static class StringCompressionExtension
{
/// <summary>
/// Compresses the string to bytes array.
/// </summary>
/// <param name="text">The text.</param>
/// <returns></returns>
public static byte[] Compress(this string text)
{
byte[] buffer = Encoding.UTF8.GetBytes(text);
@ijat
ijat / gist:e843c541f4bf2e2ea7abd5258d2b804a
Created December 12, 2020 10:02
How to remove Command Bar in OldNewExplorer for Windows 10 (Tested on 20H2)
1. Download your OldNewExplorer 1.1.9. If you already install, uninstall the extension again.
2. Download Resource Hacker.
3. Run Resource Hacker, and open OldNewExplorer64.dll.
4. Expand STYLE_FLAT or STYLE_CREAMY (your choice), then select 1:1033.
5. Ctrl+F to open Find window, and search for FolderBandStyle. You'll find something like this "<style resid="FolderBandStyle">"
6. Then, below that line, enter this text: <Element padding="rect(0rp,0rp,0rp,-44rp)"/>
7. Repeat step 5-6 by finding this keyword: CPLFolderBandStyle
8. Click Compile Script (play icon) or press F5.
9. Save the dll using same name (overwrite).
10. Repeat step 3-9 by opening OldNewExplorer32.dll
@ijat
ijat / check.cpp
Created September 5, 2020 03:22
Check if Windows 8.1 or higher c++
bool IsWindows81orHigher() {
NTSTATUS(WINAPI * RtlGetVersion)(LPOSVERSIONINFOEXW);
OSVERSIONINFOEXW osInfo;
*(FARPROC*)&RtlGetVersion = GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion");
if (NULL != RtlGetVersion)
{
osInfo.dwOSVersionInfoSize = sizeof(osInfo);
RtlGetVersion(&osInfo);
@ijat
ijat / main.cpp
Created September 4, 2020 10:48
Test winhttpopen
#include <iostream>
#include <string>
#include <Windows.h>
#include <winhttp.h>
#pragma comment(lib, "winhttp.lib")
int main() {
DWORD data;
@ijat
ijat / gist:639d2ea54d386bd69aa63fe94a3b71cf
Created August 24, 2020 02:08
pgina fork reset local user password command
Recommended to use with Scripting plugin -> Event Notification -> Tick (logon & logoff)
cmd.exe /c net user "%u" "%p" >> %PUBLIC%\reset_log.txt
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@ijat
ijat / ca.md
Created March 27, 2019 08:43 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@ijat
ijat / mssql-example-queries.md
Last active January 3, 2019 07:44
MSSQL noobies query example - basic
@ijat
ijat / udp_checksum.c
Created September 25, 2018 06:08 — forked from GreenRecycleBin/udp_checksum.c
UDP checksum
uint16_t udp_checksum(struct udphdr *p_udp_header, size_t len, uint32_t src_addr, uint32_t dest_addr)
{
const uint16_t *buf = (const uint16_t*)p_udp_header;
uint16_t *ip_src = (void*)&src_addr, *ip_dst = (void*)&dest_addr;
uint32_t sum;
size_t length = len;
// Calculate the sum
sum = 0;
while (len > 1)