Skip to content

Instantly share code, notes, and snippets.

View Plasmoxy's full-sized avatar
🌃
hopefully sleeping

Sebastián Petrík Plasmoxy

🌃
hopefully sleeping
View GitHub Profile
@buxtonpaul
buxtonpaul / wsldisplay.py
Created May 14, 2020 15:10
Quick'n'dirty python script to create the display variable for use with WSL2
#!/usr/bin/python3
import os
for line in os.popen('ipconfig.exe'):
if not line[0] in [' ', '\n']:
current_section = line
active = False
if 'Link-local IPv6 Address' in line:
active = True
@Plasmoxy
Plasmoxy / HowToSetupJenkinsCIWithGitLab.md
Last active December 16, 2023 14:44
How to setup Continous Integration for GitLab with Jenkins (works for private projects)

How to setup Continous Integration for GitLab with Jenkins

Hi, I'd like to share with you how I got my Jenkins CI set up for my private GitLab projects. This is more like a sheet of notes of mine, but I hope it'll help someone as I haven't found any good tutorial for Jenkins+Gitlab on the web yet :D

Here we go:

  • generate ssh keys on own server -> PUBLIC and PRIVATE ( no passphrase )
  • go to GitLab profile settings -> SSH keys -> add PUBLIC ssh key to GitLab = this will allow your Jenkins server to access your GitLab
  • also create full access GitLab API access token for Jenkins on your gitlab profile settings and keep it

  • install Git + GitLab plugin on Jenkins ( make sure they are enabled (ticked) in Jenkins !!!)
@goloroden
goloroden / app.js
Last active June 22, 2023 02:10
Async constructors for JavaScript
// In JavaScript, constructors can only be synchronous right now. This makes sense
// from the point of view that a constructor is a function that returns a newly
// initialized object.
//
// On the other hand, it would sometimes be very handy, if one could have async
// constructors, e.g. when a class represents a database connection, and it is
// desired to establish the connection when you create a new instance.
//
// I know that there have been discussions on this on StackOverflow & co., but
// the so-far mentioned counter arguments (such as: doesn't work as expected
@Silverbaq
Silverbaq / Server.kt
Created January 1, 2018 21:15
A simple socket-server written in Kotlin
package dk.im2b
import java.io.OutputStream
import java.net.ServerSocket
import java.net.Socket
import java.nio.charset.Charset
import java.util.*
import kotlin.concurrent.thread
@cpicanco
cpicanco / Monokai.xml
Last active March 27, 2024 21:42
Dark theme for Lazarus IDE. Copy to "userschemes" inside primary config path
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Lazarus>
<ColorSchemes Version="11">
<Names Count="1">
<Item1 Value="Monokai"/>
</Names>
<Globals Version="11">
<SchemeMonokai>
<ahaGutter Background="2238503"/>
@superdodd
superdodd / pizero-setup.md
Created September 1, 2016 05:15
Set up a Raspberry Pi Zero (with only a USB cable) via OS X
  1. Download the Raspbian Lite image from https://downloads.raspberrypi.org/raspbian_lite_latest (add .torrent to get a torrent)
  2. Unzip the download to extract the .img file
  3. Insert a FAT32-formatted SD card, and copy the image over:
    • diskutil list to identify the disk number, e.g. /dev/disk2
    • diskutil unmountDisk /dev/disk2
    • sudo dd bs=1m if=image.img of=/dev/rdisk2
  4. Before unmounting, edit a couple of files to activate internet-over-USB. The image mounted for me at /Volumes/boot.
    • In config.txt, add this as the last line of the file: dtoverlay=dwc2
    • In cmdline.txt, add this as a parameter, just after the rootwait parameter: modules-load=dwc2,g_ether
  5. Unmount the SD card (via Finder) and stick it in the Raspberry Pi.
@MightyPork
MightyPork / usb_hid_keys.h
Last active April 23, 2024 21:20
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
@moimikey
moimikey / after.js
Last active June 5, 2023 04:50
object literals for redux reducers
// O(1)
const todo = (state, action) => {
const actions = {
ADD_TODO: () => {
return {
id: action.id,
text: action.text,
completed: false
}
},
@xkr47
xkr47 / letsencrypt-jetty.sh
Last active August 29, 2023 07:22
How to use Letsencrypt certificate & private key with Jetty
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with
# the "auth" aka "certonly" subcommand
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
# convert PKCS#12 file into Java keystore format
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks
# don't need the PKCS#12 file anymore