(host)# docker pull centos
(host)# docker run -t -i centos:centos6 /bin/bash
bash-4.1# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
bash-4.1# yum install -y ruby-devel git rubygems gcc tar python-setuptools rpm-build dpkg
...
bash-4.1# git clone https://github.com/jordansissel/fpm.git
...
bash-4.1# cd fpm
bash-4.1# bundle install
$ sudo docker pull ubuntu
$ sudo docker run -t -i ubuntu:14.04 /bin/bash
root@856b6aa801af:/# apt-get update
Ign http://archive.ubuntu.com trusty InRelease
Ign http://archive.ubuntu.com trusty-updates InRelease
Ign http://archive.ubuntu.com trusty-security InRelease
Get:1 http://archive.ubuntu.com trusty Release.gpg [933 B]
Get:2 http://archive.ubuntu.com trusty-updates Release.gpg [933 B]
Get:3 http://archive.ubuntu.com trusty-security Release.gpg [933 B]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# /usr/lib/pm-utils/sleep.d/45fix-usb-wakup | |
# Disable wakup from USB devices on Sony Vaio 1311s9rb | |
function print_state { | |
cat /proc/acpi/wakeup | grep $1 | cut -f3 | cut -d' ' -f1 | tr -d '*' | |
} | |
function disable_wakup { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import textwrap | |
import sip | |
from PyQt5.QtQml import QQmlEngine, QQmlComponent | |
from PyQt5.QtWidgets import QApplication | |
from PyQt5.QtCore import QUrl | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
Item { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
Item { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt5 import uic | |
from PyQt5.QtWidgets import QWidget, QApplication | |
# Problem: the ui loader/parser is not reentrant. If another UI load is requested | |
# during loading of UI file, final layout may be corrupted. | |
# | |
# In this example "main.ui" file requests promoted widget from "widget.py", and | |
# on module level of "widget.py" UI file "widget.ui" is being loaded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import contextlib | |
@asyncio.coroutine | |
def return_coroutine_object(): | |
@asyncio.coroutine | |
def g(): | |
yield from asyncio.sleep(0.01) | |
return "return_coroutine_object" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
$ python3 --version | |
Python 3.4.3 | |
$ python3 asyncio_debug_attr_access.py | |
f result | |
$ PYTHONASYNCIODEBUG=X python3 asyncio_debug_attr_access.py | |
Traceback (most recent call last): | |
File "asyncio_debug_attr_access.py", line 21, in <module> | |
print(loop.run_until_complete(coro_func())) | |
File "/usr/lib/python3.4/asyncio/coroutines.py", line 154, in wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
If class is named as Qt class, sometimes PyQt machinery | |
leads to uncaught Python exception inside sipQWidget::qt_metacast, | |
which leads to failed Python assertion if Python is build in debug | |
mode. | |
$ ./python class_name_collision.py | |
python: ../Objects/abstract.c:2050: PyObject_Call: Assertion `(result != ((void *)0) && !PyErr_Occurred()) || (result == ((void *)0) && PyErr_Occurred())' failed. | |
Aborted (core dumped) | |
$ gdb --args ./python class_name_collision.py |
OlderNewer