Skip to content

Instantly share code, notes, and snippets.

@Lokawn
Lokawn / pdf-full-merge.js
Created December 13, 2023 17:37 — forked from mid-kid/pdf-full-merge.js
Merge all attributes of multiple PDF files using MuPDF
// Merge all attributes of multiple PDF files (pdf-full-merge.js)
// Extended from MuPDF's docs/examples/pdf-merge.js
// Ever had problems with tools that don't copy certain attributes of a PDF?
// This script uses MuPDF to merge/join/concatenate as much as possible, including:
// - bookmarks / outlines / table of contents
// - link attributes of said outlines, such as viewrect and zoom
// - whether outlines appear open or closed by default
// - annotations
// - 3d objects / PDF3D
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@Lokawn
Lokawn / colors.sh
Created December 25, 2022 12:41 — forked from mavieth/colors.sh
Bash script color output
#!/bin/bash
DARKGRAY='\033[1;30m'
RED='\033[0;31m'
LIGHTRED='\033[1;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
LIGHTPURPLE='\033[1;35m'

How to Sign and Release to The Central Repository with GitHub Actions

GitHub allows automated builds using GitHub Actions. A commonly asked question is how to release artifacts (packaged Java jars) built by Maven and Gradle to The Central Repository. The GitHub Actions documentation provides only part of the answer.

So, first, configure your Maven project for staging artifacts to The Central Repository, by reading through Configuring Your Project for Deployment and following those steps. Please make sure that the maven-gpg-plugin is configured to prevent gpg from using PIN entry programs, as follows:

<configuration>
  <gpgArguments>
      <arg>--pinentry-mode</arg>
 loopback
# coding: utf-8
# Licensed under the MIT License
# Copyright © 2016 Bharadwaj Raju <bharadwaj.raju@keemail.me>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
@Lokawn
Lokawn / Install i3 on arch.sh
Created July 26, 2022 08:14 — forked from chreniuc/Install i3 on arch.sh
Steps i followed to install arch + i3
timedatectl set-ntp true
timedatectl set-timezone Europe/Bucharest
fdisk /dev/sda
########################################
n 1G pentru /boot /dev/sda1
a - Flag it as bootable
n - 4G pentru swap /dev/sda3
n - 70G pentru / /dev/sda2
@Lokawn
Lokawn / .gitattributes
Created July 26, 2022 08:12 — forked from mezcel/.gitattributes
Alpine Linux Notes
## win10 line endins
*.bat eol=crlf
*.ps1 eol=crlf
## Linux/Posix line endins
*.go eol=lf
*.sh eol=lf
*.source eol=lf
Makefile eol=lf
@Lokawn
Lokawn / wallpaper-changer
Created July 26, 2022 08:07 — forked from daniel-j/wallpaper-changer
This is a simple random wallpaper changer to use with Awesome WM. You need to install feh to use this.
#!/bin/bash
#
# Created by djazz // Dangershy
# Dependencies: feh
#
FOLDER="~/Pictures/wallpapers"
DELAY=10
# to make it loop over lines instead of spaces in filenames
@Lokawn
Lokawn / arch-usb-uefi.md
Created July 26, 2022 08:03 — forked from elerch/arch-usb-uefi.md
Installation of Arch Linux on a USB stick with UEFI and legacy BIOS Support

Our goal here is to have one USB stick to rule them all. Objectives:

  • We want a full system - not a live CD
  • We want to boot this system on a Macbook Pro (requires UEFI)
  • We want to boot this system on a Acer C720 Chromebook (requires Legacy BIOS support)
  • We want the system "functional"

The last bullet is subject to interpretation, but I'm defining functional as:

  • X Windows works (with LXDE)