This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
UPDATECOMMAND="apt update" | |
INSTALLCOMMAND="apt install curl fuse git python3-pip -y" | |
# Update and install all dependencies | |
if [ $UID != 0 ]; then | |
sudo bash -c "$UPDATECOMMAND && $INSTALLCOMMAND" | |
else | |
$UPDATECOMMAND && $INSTALLCOMMAND |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
// Bubble sorting | |
func Bubble(slice []int) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"log" | |
"net/rpc" | |
"os" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/tls" | |
"fmt" | |
"golang.org/x/crypto/acme/autocert" | |
"log" | |
"net/http" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Install docker | |
hosts: all | |
become: true | |
tasks: | |
- name: Install list of packages | |
apt: | |
name: ['apt-transport-https','ca-certificates', 'curl', 'gnupg-agent', 'software-properties-common'] | |
state: present | |
update_cache: yes | |
- name: Add Docker GPG key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "google" { | |
credentials = "${file("credentials.json")}" | |
project = "project" | |
region = "us-central1" | |
} | |
resource "google_compute_instance" "gcp_instance" { | |
count = 1 | |
name = "test-instance-${count.index}" | |
machine_type = "f1-micro" |
OlderNewer