Skip to content

Instantly share code, notes, and snippets.

@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@sid24rane
sid24rane / net.js
Last active March 30, 2025 23:09
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@narthur
narthur / sendItToMany.sh
Last active March 24, 2022 08:16
Send email attachment to multiple recipients using Mutt
a="[email protected], [email protected]"
mutt -s "subject" -a file.pdf -- $a
@r0yfire
r0yfire / cymon_apache.py
Last active November 5, 2015 19:20
Analyze Apache logs and lookup IP addresses in Cymon for analysis and CIRT
#!/usr/bin/env python
'''
Analyze Apache log file to identify malicious request sources
'''
from os import path
import sys
import urllib
import json
def apache2_logrow(s):
@rogeriopradoj
rogeriopradoj / 1.md
Last active December 21, 2020 11:11
Dicas de como contribuir com open source by @rogeriopradoj

Olá, vamos para algumas dicas de como contribuir com opensource!

Procure seguir o fluxo base que o GitHub ensina para nós

O pessoal do GitHub tem um guia que ensina o GitHub flow, https://guides.github.com/introduction/flow/. A base que ele nos ensina é:

  • crie um branch para a alteração que você vai fazer
  • faça os commits (ou o commit único) das suas alterações
  • abra o pull request
@rob-murray
rob-murray / add_intellij_launcer
Last active May 14, 2025 20:50
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 14, 2025 16:27
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@creationix
creationix / chatServer.js
Created November 19, 2010 20:47
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client