Skip to content

Instantly share code, notes, and snippets.

@baali
baali / dlAttachments.py
Created May 8, 2012 08:32
Python script to download all gmail attachments.
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'
@SzymonPobiega
SzymonPobiega / gist:5220595
Last active April 25, 2024 17:19
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
@dwelch2344
dwelch2344 / Symmetric.java
Last active December 1, 2021 14:41
A simple example of decrypting a symmetrically encrypted file (via GPG)
import org.apache.commons.io.FileUtils;
import org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags;
import org.bouncycastle.openpgp.*;
import org.bouncycastle.openpgp.examples.ByteArrayHandler;
import org.bouncycastle.openssl.PEMReader;
import org.bouncycastle.util.io.Streams;
import java.io.*;
import java.security.NoSuchProviderException;
import java.security.Security;
@gubatron
gubatron / compiling_building_c_cpp_notes.md
Last active April 18, 2024 07:58
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015;

Last update on December 14, 2023

Updated on February 27, 2023

Updated August 29, 2019.

@alexanderjackson
alexanderjackson / seafile-pro-installer
Created May 18, 2015 18:20
seafile-pro-installer
#!/bin/bash
#set -x
# -------------------------------------------
# Vars
# -------------------------------------------
SEAFILE_ADMIN=admin@seafile.lan
SEAFILE_USER=seafile
SEAFILE_SERVER_NAME=$(hostname -s | cut -c -16)
SEAFILE_DNS=$(hostname -i)
HOSTNAME=$(hostname -i)
@winny-
winny- / gist:bb17853ffc76fbb9b039
Created November 13, 2015 01:38 — forked from nathanielc/gist:9b98350ccbcbf21256d7
Minecraft systemd unit file that uses tmux instead of screen
[root@plex ~]# cat /etc/systemd/system/minecraft@.service
[Unit]
Description=Minecraft Server %i
[Service]
WorkingDirectory=/opt/minecraft-%i
User=mcserver
Type=forking
ExecStart=/usr/bin/tmux new-session -s mc-%i -d '/bin/java -Xmx2048M -jar minecraft_server.jar nogui'

Detecting and dealing with weird file name encodings in zip files on Linux

A friend of mine recently asked me for help on a specific zip file that was supposed to contain a bunch of files with japanese names.

No matter what was used to extract or what the system locale was set to, the file names would end up garbled. We tried unzip and 7z to no avail.

After some googling I found guides that explained that you have to prevent 7z from automatically converting to utf8 by unzipping with LC_ALL=C and

Installation

  • Eine VM mit Linux
  • InfuxDB
  • Grafana
  • PHP + CURL

Einrichtung

  • Datenbank + User in InfluxDB anlegen
@Lewiscowles1986
Lewiscowles1986 / README.md
Last active November 18, 2023 19:08
Playstation 2 EU USB "The Buzz" controller

"The Buzz" Playstation 2 EU USB controller

Using tool "Simple HID Write"

  • W: Write
  • R: Read
W 00 {FF} 00 00 00 // controller 1 red light activate
W 00 {00} 00 00 00 // controller 1 red light deactivate

Run mdadm - this command is used to manage and monitor software RAID devices in linux.

mdadm --detail /dev/md0 or md<N>

mount -t ext4 /dev/md0 /share/MD0_DATA

Check disks

mdadm --examine /dev/sdd3