Skip to content

Instantly share code, notes, and snippets.

View jflopezfernandez's full-sized avatar
🏈
Merry Start of the Football Season Eve!!!

Jose Fernando Lopez Fernandez jflopezfernandez

🏈
Merry Start of the Football Season Eve!!!
View GitHub Profile
@jflopezfernandez
jflopezfernandez / asm-intel.lang
Created October 15, 2020 15:05
GTK SourceView language specification file for Intel x86-64 assembly. (WIP)
<language id="asm-intel" name="Intel x86-64 Assembly" version="2.0" _section="Source">
<metadata>
<property name="globs">*.asm</property>
<property name="line-comment-start">;</property>
</metadata>
<styles>
<style id="keyword" name="Keyword" map-to="def:keyword" />
<style id="comment" name="Comment" map-to="def:comment" />
<!--<style id="string" name="Sting" map-to="def:string" />-->
@jflopezfernandez
jflopezfernandez / timestamp.sh
Created October 4, 2020 21:14
Bash script to echo out the current time in a log-friendly format
#!/usr/bin/bash
#
# Sample Usage:
#
# $ datetime
# October 4, 2020 [05:09:09 PM EDT]
#
date '+%B %e, %Y [%r %Z]' | sed -E 's/(\s{2,})/ /g'
@jflopezfernandez
jflopezfernandez / generate-map.php
Created September 25, 2020 18:16
Quick script that generates a parallelogram-based world map, based on Matt Zandstra's decorator pattern.
<?php
abstract class Tile
{
abstract public function getWealthFactor() : int;
}
class Plains extends Tile
{
private int $wealth_factor = 2;
@jflopezfernandez
jflopezfernandez / nginx.conf
Last active September 22, 2020 19:43
NGINX Main Configuration File
# NGINX Main Configuration File
#
# Defines the user and group credentials used by worker
# processes, respectively.
#
# If the group argument is omitted, the group with the same
# name as the user argument is used.
#
user http http;
#!/usr/bin/sh
#
# Boot to the terminal without graphics as the default from now on.
systemctl set-default multi-user.target
# If and when a graphical interface is desired, simply reset the
# configuration and reboot.
systemctl set-default graphical.target && systemctl reboot
# Path: /etc/mkinitcpio.d/linux58.preset
#
# mkinitcpio preset file for the 'linux57' package
ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-5.8.1-local-x86_64"
PRESETS=('default' 'fallback')
#default_config="/etc/mkinitcpio.conf"
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES=(piix ide_disk reiserfs)
MODULES=""
# BINARIES
# This setting includes any additional binaries a given user may
#!/usr/bin/bash
# Output from `file /boot/vmlinuz-5.8.1-local-x86_64
#
# /boot/vmlinuz-5.8.1-local-x86_64: Linux kernel x86 boot executable
# bzImage, version 5.8.1-MANJARO (jflopezfernandez@www1) #1 SMP PREEMPT
# Sat Aug 15 17:38:51 EDT 2020, RO-rootFS, swap_dev 0x6, Normal VGA
mkinitcpio -k 5.8.1-MANJARO -c /etc/mkinitcpio.conf -p /etc/mkinitcpio.d/linux58.preset --verbose -g /boot/initramfs-5.8.1-local-x86_64.img
@jflopezfernandez
jflopezfernandez / install-from-source
Created August 14, 2020 22:10
A simple script to confidently install software from source without polluting the operating system with files that could potentially get left over.
#!/usr/bin/bash
# Get a list of all of the system files before installing
# the new software package.
find / | grep -v -e ^/proc/ -e ^/tmp/ -e ^/dev/ > preinstall.txt
# TODO: Install the software package.
# Get a list of all of the system files after installing
# the new software package.
@jflopezfernandez
jflopezfernandez / S_regtry.annotation
Created August 9, 2020 05:56
Annotated assembly output of the perl S_regtry function (5.32.0)
S_regtry() /home/jflopezfernandez/Downloads/perl-5.33.0/perl
Event: cycles
Percent
Disassembly of section .text:
0000000000191ac0 <S_regtry>:
S_regtry():