Skip to content

Instantly share code, notes, and snippets.

View rigred's full-sized avatar

Rigo rigred

View GitHub Profile
@rigred
rigred / amd-trademarks.md
Last active May 14, 2017 16:07
List of AMD trademarks filed with the USPTO
@rigred
rigred / Seagate ST2000DL001 F3 commands
Created May 27, 2017 15:50
Dump of the F3 commands for the ST2000DL001 Seagate Drive CC97 FW
Rst 0x20M
(P) SATA Reset
ASCII Diag mode
F3 T>
ASCII Diag mode
F3 T>/C
@rigred
rigred / easy-secure-iptables
Last active June 28, 2023 01:12
A Simple script to lock down your ubuntu/other server using iptables firewall. This script makes use of outbound rules so be sure to configure any services you need access to. Also setup your preferred ssh port.
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220"
# Allow connections to this package servers
@rigred
rigred / swipe.js
Created June 16, 2017 14:50
native js swipe
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.changedTouches[0].screenX;
@rigred
rigred / touch-swipe.js
Created June 16, 2017 15:09
old touch swipe jquery plugin
/**
Usage:
$("#element").touchwipe({
wipeLeft: function() { alert("left"); },
wipeRight: function() { alert("right"); },
wipeUp: function() { alert("up"); },
wipeDown: function() { alert("down"); },
min_move_x: 20,
min_move_y: 20,
@rigred
rigred / fizzbuzz_tiny.asm
Created August 2, 2017 19:58
A very small fizzbuzz program written in IA-32 assembly
; fizzbuzz_tiny.asm
BITS 32
org 0x08048000
ehdr: ; Elf32_Ehdr
db 0x7F, "ELF", 1, 1, 1, 0 ; e_ident
times 8 db 0
dw 2 ; e_type
dw 3 ; e_machine
dd 1 ; e_version
@rigred
rigred / zen_mce
Last active August 7, 2017 18:06
Ryzen MCE Logs
Jun 15 11:08:54 jupiter kernel: mce: [Hardware Error]: Machine check events logged
Jun 15 11:08:54 jupiter kernel: mce: [Hardware Error]: CPU 2: Machine Check: 0 Bank 2: bea0200000020136
Jun 15 11:08:54 jupiter kernel: mce: [Hardware Error]: TSC 0 ADDR 20b6f20 MISC d012000101000000 SYND f0c71d443792 IPID 200b000000000
Jun 15 11:08:54 jupiter kernel: mce: [Hardware Error]: PROCESSOR 2:800f11 TIME 1497521328 SOCKET 0 APIC 2 microcode 8001126
Jun 15 13:23:57 jupiter kernel: mce: [Hardware Error]: Machine check events logged
Jun 15 13:23:57 jupiter kernel: mce: [Hardware Error]: CPU 12: Machine Check: 0 Bank 5: bea0000000000108
Jun 15 13:23:57 jupiter kernel: mce: [Hardware Error]: TSC 0 ADDR 8016 MISC d012000101000000 SYND 4d000000 IPID 500b000000000
Jun 15 13:23:57 jupiter kernel: mce: [Hardware Error]: PROCESSOR 2:800f11 TIME 1497529432 SOCKET 0 APIC c microcode 8001126
@rigred
rigred / vkinfo_dump.log
Last active September 2, 2017 14:04
Dump of vulkaninfo tool. Uses arch extra/opencl-mesa, extra/vulkan-radeon + aur/opencl-amd
===========
VULKAN INFO
===========
Vulkan API Version: 1.0.54
INFO: [loader] Code 0 : Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_screenshot.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_core_validation.json, version "1.1.0"
INFO: [loader] Code 0 : Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_monitor.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file /usr/share/vulkan/explicit_layer.d/VkLayer_standard_validation.json, version "1.1.1"
@rigred
rigred / mesa-git_fail_4
Created September 9, 2017 21:32
mesa-git OpenGL context creation failure
Sep 09 22:19:41 jupiter sddm-greeter[1762]: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
Sep 09 22:19:41 jupiter sddm-greeter[1762]: Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBuff
Sep 09 22:19:41 jupiter systemd[1]: Created slice system-systemd\x2dcoredump.slice.
Sep 09 22:19:41 jupiter systemd[1]: Started Process Core Dump (PID 1767/UID 0).
Sep 09 22:19:42 jupiter sddm-helper[1760]: [PAM] Closing session
Sep 09 22:19:42 jupiter sddm-helper[1760]: pam_unix(sddm-greeter:session): session closed for user sddm
Sep 09 22:19:42 jupiter sddm-helper[1760]: [PAM] Ended.
Sep 09 22:19:42 jupiter systemd-coredump[1769]: Process 1762 (sddm-greeter) of user 617 dumped core.
Stack trace of thread 1762:
@rigred
rigred / OhGodWhy.bas
Created October 30, 2017 09:23
Bad BASIC - Stranger Things
10 DIM FourDigitPassword INTEGER
20 FOR i = 0 TO 9
30 FOR j = 0 TO 9
40 FOR k = 0 TO 9
50 FOR l = 0 TO 9
60 FourDigitPassword = getFourDigits(i,j,k,l)
70 IF checkPasswordMatch(FourDigitPassword) = TRUE THEN
80 GOTO 140
90 END
100 NEXT i