Skip to content

Instantly share code, notes, and snippets.

@red-stripe
red-stripe / fablabwgtn_linuxsetup.sh
Last active November 16, 2017 03:23
Fab Lab Wgtn Ubuntu 16.04 install script V0.01
#!/bin/bash
## Fab Lab Wgtn Ubuntu 16.04 install script - Hacked togeather by Craig Hobern
#Baised on the hard work of these great people:
#Francisco Sanchez - https://gist.github.com/TheBeachLab/e87feda460f1b5f64145
#Nadya Peek - https://gist.github.com/pral2a/7804545fc55b14ad0bef
# Do you want to install fab modules?
fabmodules=true
@red-stripe
red-stripe / livecheck.sh
Created July 14, 2017 01:53
Checkin script
#!/bin/bash
checkin='/opt/diylabcheck/'
online='online'
lastseen='lastseen'
printf "Verifying if $checkin$online exist... \n"
if [ -f $checkin$online ]
then
echo "Online"
rm -f $checkin$lastseen
mv $checkin$online $checkin$lastseen
@red-stripe
red-stripe / bioplastic-fastset.md
Last active September 27, 2017 20:00
Bio-plastic Fastset

Ingredients

  • 350g H2O (room temp)
  • 7g Agar
  • 20g Cornflour
  • 10g Vinegar
  • 3g glycerin (at 10% solution)

Method

Mix cornflour & 50g water in bowl.

@red-stripe
red-stripe / bioplastic_woolmix
Created September 27, 2017 19:58
Bio-plastic wool mix
### Ingredients
- 330g H2O (room temp)
- 30g glycerin (at 10% solution)
- 30g guar gum
- 5g oil
- 3g agar
- 3g chopped wool
### Method
@red-stripe
red-stripe / bioplastic-noagar.md
Created September 27, 2017 20:28
Bio-plastic without agar

Ingredients

  • 300g H2O (room temp)
  • 15g glycerin (at 10% solution)
  • 30g cornflour

Method

Mix the cornflour with 40g of water to form a sticky paste.
In a pot and the rest of the water. Heat and combine until fully dissolved.

enable wired networking

sudo ifconfig eno1 up
sudo dhclient eno1
sudo nano /etc/resolv.conf
sudo nano /etc/network/interfaces
sudo service network-manager restart

Maybe a script to re-enable on logout?
/usr/local/bin/enable-network.sh

@red-stripe
red-stripe / Git_rebase.md
Created February 13, 2018 04:59
Remove large files from solo projects

Removing large files from git

All commands are run from the root directory of your git project folder. Before you start make a backup of your entire git project elsewhere. My username is chobern, yours will be different. Unless you are future me....

Check the archive size, do you really have a problem? chobern$ du -sh .git

Run the following commands:
grub rescue> ls (hd0,2)
Check that drive is ext# formated (ie the drive with ubuntu on it)
grub rescue> ls (hd0,2)/boot/
Check that terminal outputs boot files
grub rescue> set boot=(hd0,2)
grub rescue> set prefix=(hd0,2)/boot/grub
grub rescue> insmod normal
grub rescue> normal
void MyFunct(char* buffer) {
void* myvoid; // a pointer to void can point to anything
char* b = new char[20]; // char array
myvoid = b; // memory address at myvoid is the same as at b
strcpy((char*)myvoid, "this is text"); // memory address at myvoid is 't'
std::cout << (char*)myvoid << '\n'; //print the string stored at myvoid
buffer = NULL; // set the buffer pointer to NULL
}
int main(int argc, char const *argv[]) {