Skip to content

Instantly share code, notes, and snippets.

View iddm's full-sized avatar

Shockingly Good iddm

View GitHub Profile
@iddm
iddm / install script
Last active March 1, 2023 01:44
Install PyQt5 to Mac OS X Yosemite with python3
This snippet tested on Yosemite 10.10.1
1. Define your python3 directory (for example, "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/")
2. Download "http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-mac-x64-clang-5.3.2.dmg" or any other new version of qt for mac and install it.
3. Download SIP sources here: http://www.riverbankcomputing.com/software/sip/download
4. Download PyQt5-gpl sources here: http://www.riverbankcomputing.com/software/pyqt/download5
5. Go to your downloads by terminal (for example, "cd ~/Downloads")
6. tar xvf PyQt-gpl-5.3.2.tar.gz
7. tar xvf sip-4.16.4.tar.gz
8. cd sip-4.16.4/
@iddm
iddm / gist:739b4f4cb8626098600b
Created December 7, 2014 15:02
Ubuntu/Debian broken packages fix
# Originally written by @thomas-w on stackoverflow: http://askubuntu.com/questions/515038/the-package-lists-or-status-file-could-not-be-parsed-or-openederror-during-inst
#!/bin/bash
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
sudo apt-get clean
@iddm
iddm / Debian packaging c++ applications
Created March 29, 2015 10:16
How to package a multiarchitecture-source debian package (C++/Qt):
How to package a multiarchitecture-source debian package (C++/Qt):
1. copy sources to a directory with format: <project_name>-<version>
2. cd <project_name>-<version>
3. dh_make -s -c gpl -e <email> --createorig
4. dpkg-buildpackage -S
in ~/.Xresources:
Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault
Xft.embeddedbitmap: false
@iddm
iddm / playground.rs
Created July 7, 2016 13:17 — forked from anonymous/playground.rs
Shared via Rust Playground
enum MachineState {
Normal,
Comment,
Upper,
Lower,
}
fn machine_cycle(state: &MachineState, character: char) -> (Option<char>, MachineState) {
use std::ascii::AsciiExt;
@iddm
iddm / donate.md
Created July 24, 2016 08:48 — forked from skratchdot/donate.md
My Paypal donate button in markdown format

Donation Button

Donate

@iddm
iddm / rpm-digital-signature.sh
Created October 28, 2016 09:41 — forked from fernandoaleman/rpm-digital-signature.sh
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
#lang typed/racket
(require racket/cmdline)
(: square (-> Real Real))
(define (square x)
(* x x))
@iddm
iddm / flags
Created December 1, 2017 11:20
C++ strict compiler flags
-Wall -Werror -Wextra -Wno-unused -Wcast-align -Wcast-qual -Wctor-dtor-privacy
-Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations
-Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls
-Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default
-Wundef -Wabi -Winline -Wzero-as-null-pointer-constant
@iddm
iddm / remove-docker-containers.md
Created February 21, 2018 19:30 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images