Skip to content

Instantly share code, notes, and snippets.

@gangefors
gangefors / Install FreeNAS SCALE on a partition and create a mirror.md
Last active May 13, 2024 16:03
How to install TrueNAS SCALE on a partition instead of the full disk

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

The easiest way to solve this is to modify the installer script before starting the installation process.

$disks=Get-PhysicalDisk | where {$_.operationalstatus -eq 'Transient Error'}
#Set disks to retired state
$disks | Select-Object UniqueId | ForEach-Object {
Set-PhysicalDisk -UniqueId $PSItem.UniqueId -Usage Retired
}
#remove disks from pool
$disks | ForEach-Object {
Remove-PhysicalDisk -PhysicalDisks $PSItem -StoragePoolFriendlyName 'S2D on HVCL0' -Confirm:$false
@keesun
keesun / AppConfig.java
Created January 18, 2012 15:36
Spring 3.1's Configurer Pattern
@Configuration
@EnableHello
public class AppConfig implements NameConfigurer {
@Override
public void configure(Hello hello) {
hello.setName("Thank you very much, Toby.");
}
}
@gschmutz
gschmutz / docker-compose.yml
Last active May 13, 2024 15:58
Docker Compose with Kafka Single Broker, Connect, Schema-Registry, REST Proxy, Kafka Manager
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:3.3.0
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
@aveao
aveao / bird1-bird-vultr.conf
Last active May 13, 2024 15:58
BIRD 1 and 2 configs for BGP stuffs (HE Tunnelbroker, Vultr etc)
router id [our IPv4];
protocol bgp vultr
{
local as [our ASN];
source address [our IPv4 from vultr];
import all;
export filter {
if net ~ [[the IPv4 block we want to announce]] then accept;
reject;
@Glazzes
Glazzes / App.tsx
Last active May 13, 2024 15:58
React Native pinch to zoom advanced
/**
* After some thoughts on this topic, I've decided to turn this gist along with other features into a library so you can zoom
* whatever you want.
*
* @author Santiago Zapata, Glazzes at Github <3
* @description This gist makes part of an article I'm writing about this topic (in spanish). This solution takes into account
* the linear algebra concepts and geometrical interpretation of the transform-origin property specification, this solution
* takes heavy inspiration from William's Candillon +3 year old video in this topic, however this solution brings it to the
* modern day along with a huge fix that prevents the origin from being displaced by an incorrect offset calculation after
* the first zoom interaction.
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 13, 2024 15:56
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@Starefossen
Starefossen / tmux-cheats.md
Last active May 13, 2024 15:56
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@miranda-zhang
miranda-zhang / linux.md
Last active May 13, 2024 15:55
Linux Command Cheat Sheet, Ubuntu, CentOS

Linux Command Cheatsheet

Linux Keyboard shortcuts

open terminal: Ctrl+Alt+T

Ctrl + C is used to kill a process with signal SIGINT , in other words it is a polite kill .

Ctrl + Z is used to suspend a process by sending it the signal SIGTSTP , which is like a sleep signal, that can be undone and the process can be resumed again.

@rchardptrsn
rchardptrsn / compose_sql_server.yaml
Last active May 13, 2024 15:55
Docker compose file for SQL Server 2022
services:
mssql:
container_name: mssql-db
hostname: mssql-db
image: mcr.microsoft.com/mssql/server:2022-latest
environment:
ACCEPT_EULA: 'Y'
MSSQL_SA_PASSWORD: 'Passw0rd'
MSSQL_DATA_DIR: /var/opt/mssql/data