Skip to content

Instantly share code, notes, and snippets.

View surfinky's full-sized avatar
💭
Farming

Cathal McCarthy surfinky

💭
Farming
View GitHub Profile
@sussycatgirl
sussycatgirl / mailcow_wg.md
Created February 27, 2022 14:49
Tunneling a Mailcow server through a remote server using Wireguard

Tunneling a Mailcow server through Wireguard

Mailcow is a easy to set up Mailserver running in Docker.

Unfortunately, most ISPs block port 25. In addition to that, residential IP addresses are generally blacklisted, making it impossible to self-host a mailserver at home. Mailcow by itself requires at least 6GB of RAM, which makes hosting it on a VPS rather expensive.

The solution: Running Mailcow at home and tunneling it's traffic through a cheap VPS.

The final setup will look like this:

@adulau
adulau / tor2web-list.md
Last active July 8, 2024 16:04
Tor2web and tor proxies public list

Tor2web and tor proxies public list

List of services which are giving access to Tor network and especially Tor hidden services via web interface. We keep track of potential injection or abuse from such service (the column Scam).

List

Url Status Domain Log Techno Scam
https://onion.re/ UP onion.re full custom no
@xrpdevs
xrpdevs / Barrier
Created July 6, 2021 17:53
Running Barrier pre-login on Mac OS
#!/bin/sh
## Put this file in /Library/StartupItems/Barrier
. /etc/rc.common
BARRIER="/Library/StartupItems/Barrier/barrierc_prelogin"
SERVER="192.168.7.101:24800"
SCREEN_NAME="Jamies-iMac-Pro.local"
@MitchRatquest
MitchRatquest / setup_gitea.sh
Last active April 19, 2024 18:37
Setup a local gitea server with nginx proxy
#!/bin/bash
#this script sets up a git user, installs gitea, a systemd service, and an nginx subdomain redirect
#inspired by https://golb.hplar.ch/2018/06/self-hosted-git-server.html
DOMAIN=EXAMPLE.COM #Please put your actual domain here
GIT_HOME=/opt/git #/home/git in the above tutorial
GITEA_PORT=3000 #default, but you can change it
if [[ $EUID -ne 0 ]]; then
echo "you need to be root"
exit 1
@Jiab77
Jiab77 / bridged-networking-on-wireless-interface-with-kvm.md
Last active June 27, 2024 21:06
So I needed to upgrade my home "web hosting" server from a Raspberry Pi 3b to something more flexible where I could even simulate a Raspberry Pi 3b given power. The new server hardware is now an Intel NUC i7 16GB / 250Gb SSD NVME. 😁

Bridged Networking on Wireless Interface with KVM and more...

So I needed to upgrade my home "web hosting" server from a Raspberry Pi 3b to something more flexible where I could even simulate a Raspberry Pi 3b given power. The new server hardware is now an Intel NUC i7 16GB / 250Gb SSD NVME. 😁

I order to accomplish this task I had to find a way to bridge the wireless interface which is the faster one on my actual home network setup.

I've also tried to mix the functionnality from another Rapsberry Pi (3b+ this time) who's acting as WLAN to LAN bridge. More details on this setup. But this was finally a bad idea and I was not able to make it work along the virtual network bridge created by libvirt or manually created... (I will explain why later)

The main difficulty was to use the DMZ IP address given by the router and route the traffic to the guest VM's.

Server / Desktop

@indiesquidge
indiesquidge / objects-over-classes.md
Last active January 17, 2024 09:30
We are better off avoiding ES6 classes in JavaScript when possible

Plain JavaScript objects are better than classes when they can be used, and many popular modern frameworks have adopted their use.

Consider that in React a component can be created as either a class or as an object.

// using a class
class Welcome extends React.Component {
  render() {
 Hello, {this.props.name}

Why I hate TypeScript

Warning: These views are highly oppinated and might have some slightly incorrect facts. My experience with typescript was about 2 weeks in Node and a week in angular2.

Not Standard

TypeScript is implementing their own take on JavaScript. Some of the things they are writing will likely never make it in an official ES* spec either.

Technologies that have competing spec / community driven development have a history of failing; take: Flash, SilverLight, CoffeeScript, the list goes on. If you have a large code base, picking TypeScript is something your going to be living with for a long time. I can take a bet in 3 years JavaScript will still be around without a doubt.

Its also worth noting that they have built some things like module system and as soon as the spec came out they ditched it and started using that. Have fun updating!

@waleedsamy
waleedsamy / git_valid_email.sh
Created October 11, 2015 16:16
git pre-commit hook to restrict and validate author email
#!/usr/bin/bash
# This pre-commit hook will prevent any commit by unvalid author email
# or restricted email/s regex
restrict_regex=$i
email="$(git config user.email)"
if [[ "$email" =~ "^[A-Za-z0-9._%+-]+<b>@</b>[A-Za-z0-9.-]+<b>\.</b>[A-Za-z]{2,4}$" ]]
@BobNisco
BobNisco / controller.js
Last active February 27, 2023 15:43
onLongPress AngularJS Directive - Great for mobile!
// Somewhere in your controllers for this given example
// Example functions
$scope.itemOnLongPress = function(id) {
console.log('Long press');
}
$scope.itemOnTouchEnd = function(id) {
console.log('Touch end');
}
@benjamine
benjamine / left.json
Last active July 27, 2023 20:33
Json Diff Example
{
"name": "South America",
"summary": "South America (Spanish: América del Sur, Sudamérica or Suramérica; Portuguese: América do Sul; Quechua and Aymara: Urin Awya Yala; Guarani: Ñembyamérika; Dutch: Zuid-Amerika; French: Amérique du Sud) is a continent situated in the Western Hemisphere, mostly in the Southern Hemisphere, with a relatively small portion in the Northern Hemisphere. The continent is also considered a subcontinent of the Americas.[2][3] It is bordered on the west by the Pacific Ocean and on the north and east by the Atlantic Ocean; North America and the Caribbean Sea lie to the northwest. It includes twelve countries: Argentina, Bolivia, Brazil, Chile, Colombia, Ecuador, Guyana, Paraguay, Peru, Suriname, Uruguay, and Venezuela. The South American nations that border the Caribbean Sea”including Colombia, Venezuela, Guyana, Suriname, as well as French Guiana, which is an overseas region of France”are also known as Caribbean South America. South America has an area of 17,840,000 square kilome