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 ( | |
"image" | |
"image/color" | |
"image/png" | |
"math" | |
"math/rand" | |
"os" | |
"time" |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Particles</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> |
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 ( | |
"image" | |
"image/color" | |
"image/png" | |
"math/rand" | |
"os" | |
"time" | |
) |
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 ( | |
"image" | |
"image/color" | |
"image/png" | |
"os" | |
) | |
func line(img *image.RGBA, x1, y1, x2, y2 int, color color.Color, mirror bool) { |
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" | |
func startCounting(numsLen, maxNum int) { | |
numTable := make([]int, numsLen) | |
for { | |
for i := 0; i < maxNum+1; i++ { | |
numTable[numsLen-1] = i | |
fmt.Println(numTable) |
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 | |
# Mirror a git repository | |
# usage: ./gitmirror.sh <copied-repo> <mirror-repo> | |
# | |
# example: ./gitmirror.sh https://github.com/dimkouv/app https://gitlab.com/dimkouv/app | |
if [[ $# -ne 2 ]] ; then | |
echo 'Invalid arguments!' | |
exit 1 |
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 | |
# sync.sh | |
# Syncs directories and files between two servers | |
MAIN_SERVER_IP='12.34.56.78' | |
REMOTE_KEY='/home/ubuntu/key.pem' | |
REMOTE_USER='ubuntu' | |
# from:to pairs |
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
from random import randint | |
graph = { | |
0: [1, 7], | |
1: [0, 2], | |
2: [1, 3, 4], | |
3: [2], | |
4: [2], | |
5: [6], | |
6: [7, 5], |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
#include <string.h> | |
#include <fcntl.h> | |
// counts files on the current directory | |
// linux equivalent "ls -l | wc -l" |
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
# PC2 <---eth cable--- PC1 <-- ((( wifi ))) | |
# connect as root on PC1 | |
su | |
# install networkmanager | |
pacman -S networkmanager | |
# enable networkmanager and start it | |
systemctl start NetworkManager |
NewerOlder