Skip to content

Instantly share code, notes, and snippets.

@flbuddymooreiv
flbuddymooreiv / factorio-train-schedule.md
Last active June 8, 2021 21:36
Modify factorio train schedule in lua script

This is a code dump of a script I wrote to change train schedules in factorio. The API states that the schedule must be deep-copied by value and then can be modified and set as one object rather than mutating the in-place runtime object/structure.

The deepcopy function from http://lua-users.org/wiki/CopyTable seems to work fine for this purpose.

/c
function deepcopy(orig, copies)
    copies = copies or {}
    local orig_type = type(orig)
    local copy
@flbuddymooreiv
flbuddymooreiv / japamapaj v0.7.factoriobp.txt
Last active April 23, 2021 04:15
japamapaj v0.7.factoriobp.txt
0eNrsvdtuY0uSJfgrCfWrdOB3N0905sNcMC8z041GFTCYRCDAkBgK4lCkhqIiOjJxPqD+ol/6x+pLZm9KITrJbdtt2Wbw5KmIesjKDLrMfdvFL+bma/3j6sPyef64Way2V3/+x9Xidr16uvrz3/5x9bS4X82W/b9tvz7Or/58tdjOH66ur1azh/5/bWaL5dVv11eL1d38v1/92f523fyTD/NZJ736I/fbu+ur+Wq72C7mL53u/sfX96vnhw/zTSf17W9vnzef53c3u16vrx7XT93fdLK6rvrOo3PXV1+7/+IcdeLvFpv57cvvqR/XkVT3JvVp2wm8/7Tl5eZvcvOhXDcg1wNyCyA3SLXgES1E+Wi9BUabALkekJvFWkiAFggYbQRGWwC5iI9ZAwhGnMxaueCA+IMFwi0gDmGBeAuI7WwABEPGA2IuQMYDgi5CxsuAYMh4QOBFyHhA5EXEeA6IvIgYzwGRlxDjOSDyEmI8B0ReQozngMhLkPGAyEuQ8YDIy5DxgMjLkPGAyMuQ8YDIy9C+Coi8jBjPA5FHiPE8EHmEGM8DkUeI8TwQeQQZD4g8gowHRF6BjAdEXoGMB0RegYwHRF5BjBeAyCvQkUYeeckgxgsOEIwYL3hAMGK8EADBkPEiIBgynjzykoWMlwHBkPEIEAwZrwCCEeNFAwhGjBeByHOI8SIQeQ4xXgQizyHGi0DkQYmgCEQelAmKQORBSZsIRB6UtYlA5EEJlghEHpRhSUD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Z+nqAWaS2H8ffeNXIi9P9x3ZUniXDAtWZwLZjFi7w/3jVyqqAWzGLH3h/veL13Ugs2Feeq77/0yRS2QxSqz993eRY3My3Xs+xff3rFXN8YztiYt8ANOLotasA9VPE/ysXIBAOlVCyw9zWFLbhPlDkNupxbUvjMBLChi58/dm3IrZlWJnT93b5et+FsL4lyg8HljonzJPZdERcYydr7YcbKWKb0vb8/zmooWYcQOmVap+VRsW+3MjkkDuF85rYtaoOugMWeE+zpoU9QCzaU
@flbuddymooreiv
flbuddymooreiv / modules pod v0.1
Created January 18, 2021 17:32
Modules Pod v0.1
0eNrsvd1uJEmSLvYqg9KdwFr4v5sPzpwLCYJ0sYKEPbuAoEGjwSKzuqlhkRR/erexqAc477F6sfMkikgmmZ4RbhH2mWeyi5xzs7NdJM09zN3M3c0+s+/fP325ftrc3V/dPH76879/urq4vXn49Oe//vunh6tfbs6vx397/P1u8+nPn64eN98+nX26Of82/tf9+dX1p+9nn65uLjf/9unP9vvZ6p982ZwP0qs/ct9/Ovu0uXm8erzaPA+6/Y/ff755+vZlcz9Iff3bi6f73zaXn7ejnn26u30Y/maQNQw1yMmGzj79/unPKaVB+OXV/ebi+adpnNVEphPKtEEu07/KfHgcxP3y6yMr1e+kxkOpriE1yKVGudQol5rlUpNcapFLzWKpzsqlklwqsFpFLhVYLWvkYoHlslLL8k5uBdbJ5wpsAiu3Lg/sAis3Lw9sAyu3L4/sgyRdMMAVWrl9eWRzyQ3MI/tAbmEB2AdObmEB2AfOysUC+8DJbSwAS+bkNhaAJXNyG4vIksltLCJLJj/EIrJkciuLyJLJrSwiSya3sgQsmZdbWQKWzMutLAFL5uVWloAl83IrS8CSebmVZWTJ5FaWkSWTW1lGliwLD8gMHJBebmMZ2QdyG8vAPghGqAICnjZBbmEEbK4gtzBCnkxyCyNgcwW5hRGwD4LcwgjZB3ILK8iSyc+xgiyZ3MYKsmRyGyvAkkX5OVaAJYtiKyMDLFl0crHAkkUvF4tEJoJcLLJkUS4WWTKxlZFFlizLxSJLRnKxyJIVuVgkmmTkYoElS8KoBznggExyG0OCVEluY0iUKsltDAlTJbmNIWGqJLcxJKKU5DaGRJSS3MaQiFKS2xgSUcrC2yKN10qpMWT5OYZElLLcxpCIUpbbGBJRynIbQyJKWW5jSEQpy20MiShluY0hEaUstzEkopTlNoZElEhqYxF4lJLcxpAwFcltDAlTkdzGkDAVyW0MCVOR3MaQMBUJo/eUkH0gtzAk9kVyC0NiX1SEKshAxqnI74lIQK3
@flbuddymooreiv
flbuddymooreiv / gist:bc55bb440898402a6842f54d2ecdde94
Last active January 20, 2021 17:08
Factorio 500 spm 8 beacon with unloaders
0eNrUvdtyXjeSLPwuuqYnFk4FoC/2U8zdDoVDtugexahFBSV17IkJv/u/Ph1IkFz1rcystuLvueixTbJwqEwsFFCV+N9Xv73/cvvx/t2Hz6/+9r+v3v1+9+HTq7/93/999end3z+8eX/5b5//5+Ptq7+9evf59h+vbl59ePOPy7/dv3n3/tWfN6/efXh7+/9e/S39eXP6J7/dvtmtL3+U/3x98+r2w+d3n9/dfmv067/8z68fvvzjt9v73erD3376vDf49//6/MvXdm9efbz7tP/Vbm1vbLf0S6rbvHn1P6/+1kv689KXZ5YyY6lcs1SUPpUjS/VxZt79/Zfb97e/f75/9/svH+/e3x5bswdr+1/e7k3/dvfl/jJxudfXBw20J9765bt7Dk33/2jfjef/aLv5t+/u9+58/Z16YNlwy/XBctktH9jqimsOJ3Q8WPr9y/0/b9/6dtL23c54OtZ2YHUq/Tsc6aVV3lQ/NJUUU/PQVMan7TsCa306bfnILEOU9L2HNT01XI4MV2Ho9ZDLqSmmDrGXDJ3Fdpnwr4bs6WDtyCzBjrb174Yb4J7BGG6E4ckYLrjhvDGGE2GY4dKchGHmqzMJ52WGW5NwXma4NRnnMUybjPOMMDwY5zHfpcE4bzCGGecxX6pBOK8w361BOK8wzOuE8wrDvE44rzDM64TzCsO8zjiPYV5nnMcwzxjnMcwzxnkM84xxHsM8I5xXGeYZ4bzKMK8RzqsM8xrhvMowrxHOqwzzGuM8hnmNcR7DvMo4j2FeZZzHMK8yzmOYVwnnNYZ5lXBeY5hXCOc1hnmFcF5jmFcI5zWGeYVxHsO8wjiPYV5mnMcwLzPOY5iXGecxzMuE84xhXiacZ8qZST08yTGCay39mNX5tI/9yHBR+nh4RGSV6eN3SLUE9LEJhp8P/uhkx0w47IB6rJwx1sPTMmPOTdL3FaAVoI9TMQycl/UNPpnaxnez+fxkqifGWcRE9KwYRiai4BOxHU/EoVnlPLIdnkd2hlk/lr7WgDk
@flbuddymooreiv
flbuddymooreiv / LVM on Cryptsetup.md
Last active January 10, 2021 15:28
LVM on Cryptsetup
# List your block devices with filesystems
sudo lsblk --fs

# Map the encrypted disk
sudo cryptsetup luksOpen /dev/sdb5 oldgraybook

# List volume groups
sudo vgs
0eNrtXUtyI0lyvUobljKgFf9PmTQL7bUZ005WRgPJZBU0IAABYNmU2ngAHUQX00mUkQCBBNIDkeHuZJepahZTTYLwCP+Ef557Rv4xuV++NJvtYrWffPpjsnhYr3aTT//+x2S3+LKaL9Pv9t83zeTTZLFvnifTyWr+nH5qls3Dfrt4mD0vVovVl9njdrFcTl6nk8Xqsfn75JN8nRZpbOeL/lfU6+fppFntF/tFc9hD98P3u9XL832zbWmevvnwsv3WPM46AtPJZr1rv7NepYVaOjOtjJtOvrf/pbQO7QKPi2272+4vXNrXFV11orvbtyS/fN3foCxPlOMlZQVQ1hWUdayhbGoo+xrKtoayraHsRutPi5z+NEDX1+jvLGV7SdkDlEMFZeVzlCVAOY6WhVUnuqpMV4rRhJXpEYZIyYuTOjueZnCP8veTJajw+xX/BiJec+isPhH34E7P5yzRWs12+/Ums9EepWm79Pzw+aT96+f56mW+vOso7O6Wi+fFHrZjWXP4VGnvFicICxJzuJ3BxDxuZxokFnA7g4lF3M4kREwJ3M5gYhK1MxlBYgq1swwxjdsZaLQKdwIyxHAnQIJGq3AnIEMMdwIkaLQKdwIyxHAnQIJGq3EnIEMMdwIEaLQadwIyxHAnQIBGq3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dw6NkaqUjBoZFCJN2Cc0bHGim/4NBDPTmlY429ywFrPctxcKyTEWvyFAdjrzbHmhgfETvqI1Kk0KDGmxKFBjXelCk0qFWlQqFBfUSqFBr0bE2NQgObKuMRYkPP1uwoNGikkEm30IrRsWbKLzT0UM9R61hbHjvWq7vb2ye498sf8cv/fFnMZrfjNOz8enlPaiO0qz+J8c+Pf24658HDD38x5ZlzIkUQbZ45U06modafKSfTULPMdZR6v75cTEItG1Cn4DRrzjpufm6YQtOt6WQVmuKsuXEdGm9NKOvQBGt2XIcmWhP