Skip to content

Instantly share code, notes, and snippets.

View d4rckh's full-sized avatar
💻
Coding as usual.

andrei d4rckh

💻
Coding as usual.
View GitHub Profile
@d4rckh
d4rckh / wininet.c
Created September 14, 2022 13:48
wininet get requests
#define _UNICODE
#include <tchar.h>
#include <wchar.h>
#include <Windows.h>
#include <WinInet.h>
#include <stdio.h>
int http_getrequest(char * host, int port, char * path, DWORD dwFileSize, DWORD * dwBytesRead, char * buffer) {

Keybase proof

I hereby claim:

  • I am d4rckh on github.
  • I am d4rckh (https://keybase.io/d4rckh) on keybase.
  • I have a public key ASBcHMyqpeN_Oq2cjCXk4dt5RUbLEZsp6c23gaBP-QOkkgo

To claim this, I am signing this object:

@d4rckh
d4rckh / catgrabber.js
Created March 2, 2020 14:42
Script to grab r/cats !
const request = require('request')
const fs = require('fs')
const sr = 'cats'
var i = 0
var download = function(uri, filename, callback){
request.head(uri, function(err, res, body){
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
@d4rckh
d4rckh / sketch.ino
Created November 16, 2019 16:13
Wireless Wifi
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
// Replace with your network credentials
const char* ssid = "not a free wifi";
const char* password = "pass";
ESP8266WebServer server(80); //instantiate server at port 80 (http port)
@d4rckh
d4rckh / ethstats.sh
Last active November 11, 2019 14:05
interface info linux
interface="enp3s0"
echo "Interface: $interface"
mac=$(eval "ifconfig enp3s0 | grep 'ether' | awk '{ print \$2 }'")
RX=$(eval "ifconfig $interface | grep 'RX packets' | awk '{ print \$6 }' | cut -d \"(\" -f 2")
TX=$(eval "ifconfig $interface | grep 'TX packets' | awk '{ print \$6 }' | cut -d \"(\" -f 2")
echo "RX: $RX MB"
echo "TX: $TX MB"
echo "MAC Address: $mac"