Nothing Special   »   [go: up one dir, main page]

Skip to content

Instantly share code, notes, and snippets.

View TRex22's full-sized avatar
🎮
Life

Jason Chalom TRex22

🎮
Life
View GitHub Profile
@TRex22
TRex22 / sublime-clean
Created October 16, 2020 10:25 — forked from gerardroche/sublime-clean
Clean Sublime Text caches and optionally clean out any sessions
# 301 https://github.com/gerardroche/dotfiles
@TRex22
TRex22 / tmux-cheatsheet.markdown
Created March 12, 2020 07:51 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Firing up LaTex on macOS 🔥

As I'm writing this small tutorial, I assume you've read my previous one about setting up macOS, so if for any tool I'll use without explanation, look to that other article.

MacTex

The full version IS NOT MANDATORY, as in the tutorial that follows I installed the smaller version of MacTeX and proceded installing every needed dependency. Installing the complete package is about ~3.5GB of download and ~5GB on disk, the smaller one is just about 80MBs.

Click here to download the complete version or here to download the smaller version.

Gnuplot

@TRex22
TRex22 / arch-rpi-64-full-disk-encryption-ssh-unlock.md
Created August 13, 2019 16:04 — forked from gea0/arch-rpi-64-full-disk-encryption-ssh-unlock.md
Tutorial for installing a 64-bit Arch Linux ARM system on the Raspberry Pi 3B+, with an encrypted root filesystem, and the option to remotely unlock it via a pre-boot SSH daemon.

Arch Linux ARM 64 on Raspberry Pi 3 B+ With Full Disk Encryption And SSH Unlock: 2018 Edition

There are multiple ways to get a full disk encrypted arch linux system on raspberry. In this tutorial, we will install a 64-bit arch linux armv8 system, using dropbear as ssh server for remote pre-boot unlocking of the root filesystem. However, it will still be possible to unlock and use the pi as usual, with a keyboard and monitor. We will also create an unencrypted partition in the installation process, usable as a rescue system.

Differences to the 32-bit arch linux arm version:

  • probably better performance
  • can run 64-bit software
  • comes without the proprietary video-driver blobs
@TRex22
TRex22 / string_parser.rb
Created April 22, 2019 16:11
StringParser ruby service
module StringParser
extend self
def numeric?(str)
!!(str =~ /\A[+-]?\d+(\.[\d]+)?\z/)
end
def integer?(str)
!!(str =~ /\A[+-]?\d+\z/)
end
@TRex22
TRex22 / chunk_time.rb
Last active February 8, 2019 10:27
Chunk Time in ruby
TIME_CHUNK_INTERVAL = 10.hours
# [[start,end], [start,end]...]
def fetch_time_chunks(start_time, end_time, time_interval = nil)
interval = time_interval || TIME_CHUNK_INTERVAL
time_delta = end_time - start_time
number_of_chunks = (time_delta / interval).to_i
return [[start_time, end_time]] if number_of_chunks == 0
@TRex22
TRex22 / StringSanitizer.rb
Last active April 22, 2019 16:09
Useful Unicode Regex (Ruby)
module StringSanitizer
extend self
##
# This is used for different kinds of cleanup of a string
# Use cases:
# 1. When creating reports in different formats with varying support for unicode.
# 2. For Data inputs to remove whitespace and strange characters which are not "language"
# 3. External services which may not be able to handle different character sets
# 4. Comparisons - when comapring two strings which have whitespace and weird unicode
@TRex22
TRex22 / gist:5f3d75aef2727d9c536f017245b0afd1
Last active October 22, 2018 15:20 — forked from longlostnick/gist:1251339
Delete all empty/false elements from Array of key value pairs recursively
module ArrayKeyValueCleaner
extend self
# This makes use of a recursive proc to recurse into a deeply
# nested set of arrays
#
# At the deepest array it will check if the next set of children
# are not arrays and make sure they are valid key value pairs
def call(value)
return value unless value.is_a?(Array)
@TRex22
TRex22 / BashGitUsefulScripts.md
Last active February 4, 2020 10:37
Useful Bash, Git and Other Scripts and Aliases

Kill a process by ip connection

kill -9 $(lsof -i tcp:80 -t)

Reset OpenSSH-Server config (debian dpkg based)

sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server

Aliases