Skip to content

Instantly share code, notes, and snippets.

@motorailgun
motorailgun / idea.md
Last active November 16, 2023 03:13
Installing Windows and Linux into the same partition

Installing Windows and Linux into the same partition

But WHY?

There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /(C:\), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.

Pre-requirements

  • UEFI system
  • Any Linux live-boot CD/DVD/USB... with Linux kernel newer than 5.15
  • Windows installer USB
@etiennetremel
etiennetremel / README.md
Last active April 26, 2024 22:33
Simple Wireguard setup as VPN server and multiple clients

Simple WireGuard configuration

1 server, 2 clients

Getting started

Install Wireguard on all machines.

Generate all keys

@mottosso
mottosso / 0_README.md
Last active July 7, 2023 12:48
Bi-directional communication over Popen

Bi-directional Communication over Popen

This gist illustrates how two processes can exchange information via subprocess.Popen.

untitled

Goal

Integrate an externally running user interface, potentially written in another language. For example, a GUI written in PyQt5 and Python 3 running inside of Autodesk Maya (Python 2.7, PySide).

@ucarion
ucarion / each_cons.rs
Created December 22, 2014 23:37
Rust each_cons
#![feature(slicing_syntax)]
use std::collections::RingBuf;
fn main() {
let xs = &[1i, 2i, 3i, 4i, 5i];
let mut iter = EachCons { iter: xs.iter(), n: 3, buffer: RingBuf::new() };
for x in iter {
println!("{}", x);
@pietsch
pietsch / gist:a74f810277a52f3a0fb9
Last active February 17, 2016 10:35
How to install GitLab CI on openSUSE 12.3 GNU/Linux

Installing GitHub CI 5.0 on openSUSE 12.3

Although this GNU/Linux distro is not supported, were are already running GitLab on an openSUSE server, so let's see if we can set up a GitLab CI (Continuous Integration) server on openSUSE, too. These notes are basically a translation of http://doc.gitlab.com/ci/install/installation.html to SuSE. See also other unofficial GitLab installation guides: https://github.com/gitlabhq/gitlab-public-wiki/wiki/Unofficial-Installation-Guides

1. Packages / Dependencies

Installing the prerequisites is already a hassle, but I was able to map most of the Debian package names to SuSE's naming scheme using distromatch. So here we go:

sudo ln -s /usr/bin/vi /usr/local/bin/editor  ## give your favourite text editor a standard name
@first087
first087 / MainActivity.java
Last active February 14, 2024 00:22
Android Application : In-app Billing Example. Test app at https://play.google.com/store/apps/details?id=com.ethanf.in_app_billing_ex
package com.ethanf.in_app_billing_ex;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import com.android.vending.billing.IInAppBillingService;
import android.os.Bundle;
@willurd
willurd / web-servers.md
Last active April 26, 2024 18:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ignacysokolowski
ignacysokolowski / pulse_simple_play.py
Created October 29, 2012 11:20
Python: Play a WAV file with PulseAudio simple API
#!/usr/bin/env python
import ctypes
import wave
import sys
pa = ctypes.cdll.LoadLibrary('libpulse-simple.so.0')
PA_STREAM_PLAYBACK = 1
PA_SAMPLE_S16LE = 3
@javiertoledo
javiertoledo / README.txt
Created September 7, 2012 03:40
Hack to allow unions on ActiveRecord models
Add union_hack.rb to your project, for example at lib folder and ensure you're loading it on your application.rb file:
# You'll need to add something like that
config.autoload_paths += %W(#{config.root}/lib)
Then extend your favourite model with the module and you'll be able to do unions with unique records, sorted by any fields and limited in number of records (see my_timeline_method):
class Profile < ActiveRecord::Base
extend UnionHack