Skip to content

Instantly share code, notes, and snippets.

View JeffLabonte's full-sized avatar
:octocat:

Jeff Labonte JeffLabonte

:octocat:
View GitHub Profile
@JeffLabonte
JeffLabonte / prime.patch
Created March 11, 2018 05:19
Diff PRIME - Ubuntu Doc
diff --git a/Ubuntu-linux-on-Dell-XPS-15-(9560).md b/Ubuntu-linux-on-Dell-XPS-15-(9560).md
index 939305c..a2f0574 100644
--- a/Ubuntu-linux-on-Dell-XPS-15-(9560).md
+++ b/Ubuntu-linux-on-Dell-XPS-15-(9560).md
@@ -164,6 +164,34 @@ Now launching "Additional drivers" from the dash will provide more options, in p
The nVidia driver seems to work fine, and provides GPU acceleration. It also solves the window manager corruption after resuming from suspend caused by previous versions of the driver.
+#### How to use PRIME
+
@JeffLabonte
JeffLabonte / gist:251090aa9677ccf7d31dbd4ae0f21598
Created March 17, 2018 14:42
Error from building a Snap of eve online on Ubuntu 17.10
Skipping pull wine-3p2 (already ran)
Skipping build wine-3p2 (already ran)
Skipping stage wine-3p2 (already ran)
Skipping prime wine-3p2 (already ran)
Skipping pull enable-i386 (already ran)
Skipping build enable-i386 (already ran)
Skipping stage enable-i386 (already ran)
Skipping prime enable-i386 (already ran)
Skipping pull wine-3p1 (already ran)
Skipping build wine-3p1 (already ran)
@JeffLabonte
JeffLabonte / gist:f13144fe298c44000aba0e9f0395afd8
Last active August 14, 2018 02:26 — forked from gmas/gist:b5fd3d038905d1265485
switch gcc versions in debian
#install new versions of gcc and g++
sudo apt-get install gcc-4.8 g++-4.8
#remove existing alternatives
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
#add new and old version to update-alternatives db
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-8
@JeffLabonte
JeffLabonte / wakelock.service
Created November 18, 2018 21:10
Lock screen after suspend with i3lock and systemd
# file /etc/systemd/system/wakelock.service
[Unit]
Description=Lock the screen on resume from suspend
[Service]
User=victor
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock
@JeffLabonte
JeffLabonte / args_bash
Last active October 8, 2019 17:18
This is the way arguments are to handled when you have many of them!
while test $# -gt 0
do
case $1 in
--usage | --help | -h )
usage_and_exit 0
;;
--version | -v )
version
exit 0
;;
@JeffLabonte
JeffLabonte / config files
Created March 24, 2019 19:32
Neofetch debugging informations
# Neofetch config file
# https://github.com/dylanaraps/neofetch
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info underline

C extension Python - Argument from Python

The C extension can handle only METH_VARARGS which is only tuple and METH_VARARGS | METH_KEYWORDS

Note the third entry (METH_VARARGS). This is a flag telling the interpreter the calling convention to be used for the C function. It should normally always be METH_VARARGS or METH_VARARGS | METH_KEYWORDS; a value of 0 means that an obsolete variant of PyArg_ParseTuple() is used.

When using only METH_VARARGS, the function should expect the Python-level parameters to be passed in as a tuple acceptable for parsing via PyArg_ParseTuple(); more information on this function is provided below.
>>> def f(x):
return x % 2 != 0 and x % 3 != 0
>>> filter(f, range(2, 25))
[5, 7, 11, 13, 17, 19, 23]
>>> def cube(x):
return x*x*x
>>> map(cube, range(1, 11))
[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]
- name: source bashrc
sudo: no
shell: source /home/username/.bashrc && [the actual command you want run]
args:
executable: /bin/bash
ADD http://example.com/big.tar.xz /usr/src/things/
RUN tar -xJf /usr/src/things/big.tar.xz -C /usr/src/things
RUN make -C /usr/src/things all