Skip to content

Instantly share code, notes, and snippets.

View mbartosi's full-sized avatar

Marek Bartosiewicz mbartosi

  • 05:23 (UTC +02:00)
View GitHub Profile
@damico
damico / test-rocm.py
Created April 10, 2023 18:54
Script for testing PyTorch support with AMD GPUs using ROCM
import torch, grp, pwd, os, subprocess
devices = []
try:
print("\n\nChecking ROCM support...")
result = subprocess.run(['rocminfo'], stdout=subprocess.PIPE)
cmd_str = result.stdout.decode('utf-8')
cmd_split = cmd_str.split('Agent ')
for part in cmd_split:
item_single = part[0:1]
item_double = part[0:2]
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active April 18, 2024 11:20
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@AlecsFerra
AlecsFerra / animated_wallpaper.c
Last active November 6, 2023 21:52
POC for simple animated wallpapers in Xorg
#define _POSIX_C_SOURCE 199309L
//#define DEBUG
#include <Imlib2.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@thanatos
thanatos / howto-k8s.md
Created December 7, 2019 19:12
How to init k8s cluster on Gentoo

Install Stuff

Emerge kubelet, kubeadm, kubectl, all the same version. For some reason, Gentoo stablized kubelet and kubectl but not kubeadm.

I'm using Calico, so also emerge net-misc/calico-cni-plugin.

Correct Stuff

@Jiab77
Jiab77 / bridged-networking-on-wireless-interface-with-kvm.md
Last active January 18, 2024 05:00
Bridged Networking on Wireless Interface with KVM and more...

Bridged Networking on Wireless Interface with KVM and more...

So I needed to upgrade my home "web hosting" server from a Raspberry Pi 3b to something more flexible where I could even simulate a Raspberry Pi 3b given power. The new server hardware is now an Intel NUC i7 16GB / 250Gb SSD NVME. 😁

I order to accomplish this task I had to find a way to bridge the wireless interface which is the faster one on my actual home network setup.

I've also tried to mix the functionnality from another Rapsberry Pi (3b+ this time) who's acting as WLAN to LAN bridge. More details on this setup. But this was finally a bad idea and I was not able to make it work along the virtual network bridge created by libvirt or manually created... (I will explain why later)

The main difficulty was to use the DMZ IP address given by the router and route the traffic to the guest VM's.

Server / Desktop

@mailhost
mailhost / dsdt.patch
Created June 10, 2019 14:32
Dell Precision 5510 1.10.0 DSDT fixes
--- dsdt.orig 2019-06-10 16:09:40.945676250 +0200
+++ dsdt.dsl 2019-06-10 16:28:15.274723137 +0200
@@ -3905,11 +3905,13 @@
If (LEqual (PM6H, One))
{
CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW) // _RW_: Read-Write Status
- Store (Zero, ECRW (If (PM0H)
- {
- CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN) // _LEN: Length
- Store (Zero, F0LN) /* \_SB_.PCI0._CRS.F0LN */
@rjdp
rjdp / coursera_downloader.py
Last active December 22, 2020 16:49
Script for downloading course Lectures from coursera specialization or individual course
import os
import requests
import time
import sys
video_quality = "540p" # available qualities 360p, 540p, 720p
"""
In order to get courseId go to a course page open network tab in browser dev tools and search for "onDemandSpecializations"
in search input of network tab and then go to videos section of say week 1 , check the query param "courseId" its value is what we use can use as value for "one_of_specialization_course_id"
@maty974
maty974 / asus_gl703VM_tips_workaround.md
Last active December 7, 2018 22:29
Centos 7 on ASUS GL703VM - Tips & Workaround

ASUS GL703VM tips & Workaround

Keyboard

Not working:

  • Fn+F12 : airplane mode
  • Fn+F11 : sleep mode
  • Fn + F7-8 : lcd backlight brightness
  • Fn+F5 : fan turbo mode?
@bvis
bvis / Jenkinsfile
Last active January 3, 2023 20:45
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"