Skip to content

Instantly share code, notes, and snippets.

View zulonas's full-sized avatar

Kasparas Zulonas zulonas

View GitHub Profile
@zulonas
zulonas / bheap.py
Created April 5, 2020 16:38
Max heap implementation using binary tree(in array) (Python)
#!/usr/bin/python3
#max heap implementation
class Bin_heap:
def __init__(self, input_heap = []):
self.heap = input_heap
if (input_heap):
self.build_heap()
def heapify(self, n, i):
@zulonas
zulonas / tprint.lua
Last active August 27, 2020 13:04 — forked from xytis/gist:5361405
Print Lua table recursively.
local function tprint(tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
local formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
tprint(v, indent+1)
else
print(formatting .. tostring(v))
end
@zulonas
zulonas / DSSS-modulation.m
Created November 14, 2020 21:29
DSSS modulation
clearvars;
init_seq = [0, 1, 0, 1, 0, 0, 1, 0];
bit_sample = 8; % bit sample size
% Expanding bit sequence with by bit_sample size
bit_seq = zeros(1, bit_sample .* length(init_seq));
k = 1;
for i=1:length(init_seq)
for j=1:bit_sample

Ubuntu setup(but without bloatware)

Download ubuntu(server) from: https://ubuntu.com/download/server.

In linux you can make bootable usb using dd command:

sudo dd if=file_name_ubuntu_server.iso of=/dev/sdX bs=4M status=progress
#!/bin/bash
# Extract any video from adobe connect
#
# requirements: wget, unzip, ffmpeg
set -euo pipefail
if [ $# -eq 0 ]; then
echo "Usage: $0 video-url"
exit 1
@zulonas
zulonas / lab31.ipynb
Last active May 20, 2021 19:39
lab31.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zulonas
zulonas / lab32.ipynb
Created May 20, 2021 14:43
lab32.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zulonas
zulonas / dump_socket.sh
Created June 9, 2021 08:09 — forked from jhass/dump_socket.sh
Capture unix socket to pcap file with socat and tshark
#!/bin/bash
# Parameters
socket="/run/foo.sock"
dump="/tmp/capture.pcap"
# Extract repetition
port=9876
source_socket="$(dirname "${socket}")/$(basename "${socket}").orig"
#include <stdio.h>
#include <syslog.h>
#define LOG(FORMAT, ...) {\
openlog(NULL, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);\
syslog(LOG_INFO, "%s:%d " FORMAT "\n", __BASE_FILE__, __LINE__, ##__VA_ARGS__);\
closelog();\
}
int main()
#!/bin/bash
sudo apt update -y && sudo apt dist-upgrade -y
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh && rm get-docker.sh
sudo groupadd docker
sudo usermod -aG docker $USER