Skip to content

Instantly share code, notes, and snippets.

@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 9, 2024 17:51
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@jberger
jberger / adduser.sh
Last active May 9, 2024 17:54
Create User Without Password
# create user with a disabled password
adduser myusername --disabled-password
# optionally login as them and create authorized_keys
# su - myusername
# mkdir --mode=0700 .ssh
# echo 'key' > .ssh/authorized_keys
# chmod 0600 .ssh/authorized_keys
# ^d
@petelacey
petelacey / one_drive.ex
Created February 24, 2024 23:02
Sample Elixir code to upload large documents to OneDrive via the MS Graph API
defmodule OneDrive
require Logger
@graph_api_url "https://graph.microsoft.com/v1.0/"
# The parent_drive_item is a Graph API driveItem object representing the root folder the file it to be uploaded to.
# There are many other representations left as an exercise to the reader
#
# The remote_file_path variable has the complete path to the file on the OneDrive side, e.g. /foo/bar/baz.txt
# If either the /foo or /bar folders are not already there, they will be created. They do not have to be created
@rathorsunpreet
rathorsunpreet / win2ix.md
Last active May 9, 2024 17:48 — forked from carlessanagustin/win2ix.md
Windows and Unix command line equivalents
Windows command Unix command Notes
set env Set on Windows prints a list of all environment variables. For individual environment variables, set is the same as echo $ on Unix.
set Path export $PATH Print the value of the environment variable using set in Windows.
set PROJ -- result: PROJ=c:\project
echo %PROJ% echo $PROJ result: c:\project

|

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 9, 2024 17:46
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@tristanm
tristanm / README.md
Last active May 9, 2024 17:44
Migrating a Rails project from MySQL to PostgreSQL

Migrating a Rails project from MySQL to PostgreSQL

This brief guide is written from my own experience with migrating a large (~5GB) MySQL database to PostgreSQL for a Rails project.

No warranties, guarantees, support etc. Use at your own risk and, as always, ENSURE YOU MAKE BACKUPS FIRST!

I chose [pgloader][1] because it's extremely fast. YMMV.

  1. Replace mysql2 gem with pg in Gemfile.
  2. Update config/database.yml for PostgreSQL. I used [Rails' template][2] as a starting point.
@SimonCropp
SimonCropp / ClientConsole
Created May 19, 2011 02:34
non blocking client server with httplistener
using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
namespace ClientConsole
{
static class Program
{
@volosincu
volosincu / arch-linux-uefi-install.md
Last active May 9, 2024 17:38
Arch linux UEFI installation guide

Arch Linux UEFI installation guide

1) Partitioning

a) create partitions using a tool like gdisk, cfdisk .... (more about partitioning )

b) after partifioning we must build the filesystems on the devices (format partitions) using mkfs

   
 mkfs.vfat -F 32 /dev/sdX1 // format efi-boot partition as FAT 32 
@conorbranagan
conorbranagan / gist:4513828
Last active May 9, 2024 17:37
Linux System Metrics

Linux System Metrics

CPU

  • system.cpu.idle: % Idle CPU
  • system.cpu.system: % System CPU
  • system.cpu.user: % User CPU

Disk