Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
from os import getuid
from subprocess import run
from sys import exit, stderr
MAIN_PATH = '/usr/share/X11/xkb/symbols/fr'
BACKUP_PATH = MAIN_PATH + '.bck'
@r3n4ud
r3n4ud / Instructions.md
Created July 19, 2018 11:24 — forked from kalebo/Instructions.md
Instructions on setting up a FlexLM daemon for SystemD

Setting up a FlexLM service for SystemD

Create directory structure

  1. Create the directory for the flexlm user to use, e.g., /opt/flexlm
  2. Place all the binaries for the licence manager and the licence in a vendor specific subdirectory

At this point you should have something similar to following directory structure:

/opt/flexlm/
└── VENDOR

Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

sudo apt-get install git build-essential
test `uname -m` = x86_64 && sudo apt-get install ia32-libs
git clone https://github.com/raspberrypi/tools.git
export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH
git clone http://github.com/mozilla/rust.git
cd rust
./configure --target-triples=arm-unknown-linux-gnueabihf

make

@r3n4ud
r3n4ud / gist:4194572
Created December 3, 2012 12:03
Java debian alternative
#!/bin/bash
# for i in itweb-settings itweb-settings.1.gz jexec jexec-binfmt keytool keytool.1.gz orbd orbd.1.gz pack200 pack200.1.gz policytool policytool.1.gz
rmid rmid.1.gz rmiregistry rmiregistry.1.gz servertool servertool.1.gz tnameserv tnameserv.1.gz unpack200 unpack200.1.gz
# do
# echo "--------------------------------------------------------------------------------\n"
# update-alternatives --query $i
# echo "--------------------------------------------------------------------------------\n"
# done
@r3n4ud
r3n4ud / gist:4188485
Created December 2, 2012 12:46
Rubinius FFI specs status
$ find spec/core/ffi -type f | sort
spec/core/ffi/add_typedef_spec.rb
spec/core/ffi/config_hash_spec.rb
spec/core/ffi/config_spec.rb
spec/core/ffi/find_type_spec.rb
spec/core/ffi/library/attach_foreign.rb
spec/core/ffi/library/attach_function_spec.rb
spec/core/ffi/library/ffi_lib_spec.rb
spec/core/ffi/library/native_function.rb
spec/core/ffi/memorypointer/address_spec.rb
@r3n4ud
r3n4ud / Problematic code (assumption)
Created November 30, 2012 23:43
Unable to find foreign function in rubinius
typedef :pointer, :libusb_context
typedef :pointer, :libusb_device_handle
attach_function 'libusb_set_configuration', [:libusb_device_handle, :int], :int, :blocking=>true
attach_function 'libusb_claim_interface', [:libusb_device_handle, :int], :int
attach_function 'libusb_release_interface', [:libusb_device_handle, :int], :int, :blocking=>true
[…]
attach_function 'libusb_handle_events', [:libusb_context], :int, :blocking=>true
@r3n4ud
r3n4ud / gist:4179472
Created November 30, 2012 23:31
FFI::Platform.windows? is not defined in rubinius
$ ruby -rlibusb -e ''
An exception occurred requiring command line files
undefined method `windows?' on FFI::Platform (Module) (NoMethodError)
Backtrace:
Kernel(Module)#windows? (method_missing) at kernel/delta/kernel.rb:81
LIBUSB::Call.__module_init__ (Call) at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/libusb-0.2.2/lib/libusb/call.rb:24
LIBUSB.__module_init__ (LIBUSB) at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/libusb-0.2.2/lib/libusb/call.rb:21
Object#__script__ at /home/renaud/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/libusb-0.2.2/lib/libusb/call.rb:19
Rubinius::CodeLoader.require at kernel/common/codeloader.rb:212