Skip to content

Instantly share code, notes, and snippets.

View xicopitz's full-sized avatar
🕸️
.

Francisco Coelho xicopitz

🕸️
.
  • Lisbon, PT
View GitHub Profile
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 2, 2024 01:13
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@eouw0o83hf
eouw0o83hf / UploadController.cs
Created August 23, 2018 02:24
File upload with React component and dotnet core web API controller
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Demo.Web.Controllers
{
public class UploadController : Controller
{
@JinhaiZ
JinhaiZ / Direct_ethernet_connection.md
Last active September 28, 2021 19:35
Direct Ethernet connection to Raspberry Pi/Odroid without router (with DHCP, tested on Ubuntu 16.04)

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Direct Ethernet connection to Raspberry Pi/Odroid without router

The solution is based on running DHCP service at your workstation (your notebook for example), and use it to attribute an IP address to your Raspberry Pi/Odroid. Then use ssh to connect to your Raspberry Pi/Odroid through this IP address.

Terminology Explaination
Client Your Single Board Computer, such as a Raspberry Pi or an Odroid
Server Your workstation with any linux based systems, like Ubuntu
@MoOx
MoOx / solution1.js
Created September 8, 2016 22:16
avoid "windows is undefined" error when in node for React component
import React, { Component } from "react"
import styles from "./index.css"
export default class Hero extends Component {
componentDidMount() {
if (typeof window !== "undefined") {
require("particles.js").particlesJS.load("particles-js", "assets/particles.json", function() {
console.log("callback - particles.js config loaded")
@sid24rane
sid24rane / udp.js
Created July 25, 2016 08:39
Simple UDP Client and Server in Node.js ==> ( Echo Server )
var udp = require('dgram');
// --------------------creating a udp server --------------------
// creating a udp server
var server = udp.createSocket('udp4');
// emits when any error occurs
server.on('error',function(error){
console.log('Error: ' + error);
@dmouse
dmouse / Dockerfile
Last active June 2, 2022 20:52
Run Firefox or Google Chrome into a Docker container | based on http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/
FROM ubuntu:14.04
# Replace 1000 with your user / group id
RUN export uid=1000 gid=1000 && \
mkdir -p /home/developer && \
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:${uid}:" >> /etc/group && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer && \
chown ${uid}:${gid} -R /home/developer
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt