Skip to content

Instantly share code, notes, and snippets.

@geekgonecrazy
geekgonecrazy / block-kiddies.sh
Created November 18, 2012 05:56
block script kiddies
## Need to check this more. Could probably automate it and make it an actual script. As is don't run. Could end up banning your self
grep "Failed password for root from" /var/log/auth.log | cut -d " " -f 11 | sort | uniq >> banips
grep "Failed password for invalid user" /var/log/auth.log | cut -d " " -f 13 | sort | uniq >> banips
# Check banips make sure yours isn't there. Could be bad otherwise.
for line in $(cat banips); do echo "iptables -I INPUT -s $line -j DROP" >> iptablesblock; done;
chmod +x iptablesblock
@edwinwebb
edwinwebb / gist:5155504
Last active February 1, 2019 15:39
A simple less loop with comments and simple from, to syntax.
/* Define two variables as the loop limits */
@from : 0;
@to : 10;
/* Create a Parametric mixin and add a guard operation */
.loop(@index) when(@index =< @to) {
/* As the mixin is called CSS is outputted */
div:nth-child(@{index}) {
top: unit(@index * 100, px);
@graywolf336
graywolf336 / config.yml
Last active December 30, 2015 12:29
Jail 3.0 Default Config
# ###################
# Jail v3.0.0-SNAPSHOT-b206 config file
# Note: You -must- use spaces instead of tabs!
# ###################
system:
configVersion: 3
debug: false
language: en
updateNotifications: true
useBukkitTimer: true
@aadnk
aadnk / BukkitSerialization.java
Created December 26, 2013 20:17
Serialize and deserialize inventories to a string.
package com.comphenix.example;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.bukkit.Bukkit;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.io.BukkitObjectInputStream;
@pbojinov
pbojinov / README.md
Last active June 24, 2024 05:39
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@demisx
demisx / angularjs-providers-explained.md
Last active May 17, 2024 03:38
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@eyecatchup
eyecatchup / hosts
Last active July 12, 2023 08:53
Disable Skype ads: 1.) Add hosts to your hosts file 2.) Flush DNS resolver cache (ipconfig /flushdns)
# Block Skype ads
127.0.0.1 *.msads.net
127.0.0.1 *.msecn.net
127.0.0.1 *.rad.msn.com
127.0.0.1 a.ads2.msads.net
127.0.0.1 ac3.msn.com
127.0.0.1 ad.doubleclick.net
127.0.0.1 adnexus.net
127.0.0.1 adnxs.com
127.0.0.1 ads1.msn.com
/*
EXAMPLE MESSAGE
/poll "question?" "option 1" "option 2"
*/
/** Global Helpers
*
* console - A normal console instance
* _ - An underscore instance
@geekgonecrazy
geekgonecrazy / Go-get-private-github.md
Last active January 28, 2018 01:53
Configure for go get

Get personal access token from github

git config --global url."https://${GITHUB_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"

@notwaldorf
notwaldorf / list.md
Last active January 13, 2024 11:09
Meownica's packing list

Meownica's packing list

I travel a lot so I'm down to like 30 minutes of packing per any kind of trip. I always bring one carry-on suitcase for any trips up to 2 weeks (that I never check in unless forced) -- I have an Away suitcase because it's got a built-in (removable) battery, and amazing wheels.

🚨

  • 🆔Wallet & Passport
  • 💧Travel water bottle
  • 💳Travel credit cards (don't pay foreign currency fees!)
  • 💳Insurance cards
  • 💵Local currency you have
  • 🚎Local public transport cards