Skip to content

Instantly share code, notes, and snippets.

@dcalixto
dcalixto / ubuntu-hardening.md
Created April 17, 2020 08:31 — forked from lokhman/ubuntu-hardening.md
List of things for hardening Ubuntu

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
Rails.logger.debug(ActiveSupport::LogSubscriber.new.send(:color, "D:#{var}", :red))
@rgl
rgl / qemu-arm.md
Last active December 23, 2023 02:26
run emulated arm under qemu

This will show how to run an emulated arm64 virtual machine under qemu.

It first shows how to launch a typical amd64 virtual machine to make sure we have cloud-init working.

Then it shows how to launch the arm64 (aka aarch64) virtual machine.

NB In my humble i3-3245 amd64 host this is way too slow to run anything useful as it takes about 6m to allow you to finally login, and after that, its slow too. You are really better off with a proper physical arm64 machine, like:

# Just a copy of https://stackoverflow.com/a/30724359/1825727
def from_hashstring(value)
json_string = value
.gsub(/([{,]\s*):([^>\s]+)\s*=>/, '\1"\2"=>') # Handle ruby symbols as keys
.gsub(/([{,]\s*)([0-9]+\.?[0-9]*)\s*=>/, '\1"\2"=>') # Handle numbers as keys
.gsub(/([{,]\s*)(".+?"|[0-9]+\.?[0-9]*)\s*=>\s*:([^,}\s]+\s*)/, '\1\2=>"\3"') # Handle symbols as values
.gsub(/([\[,]\s*):([^,\]\s]+)/, '\1"\2"') # Handle symbols in arrays
.gsub(/([{,]\s*)(".+?"|[0-9]+\.?[0-9]*)\s*=>/, '\1\2:') # Finally, convert => to :
JSON.parse(json_string)
@hulous
hulous / .rubocop.yml
Last active December 6, 2022 21:30
Basecamp rubocop config inspiration. This template is inspired on https://gist.githubusercontent.com/lazaronixon/7815d84702f277ead5e89c9f2aa5581f/raw/rubocop.yml
# This template is inspired on https://gist.githubusercontent.com/lazaronixon/7815d84702f277ead5e89c9f2aa5581f/raw/rubocop.yml
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
Rails:
Enabled: true