Skip to content

Instantly share code, notes, and snippets.

Avatar

Burak Arslan plq

View GitHub Profile
View README.md

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow 3G -l 600ms -p 10%   # slow network on eth0 and setup latency to 600ms packetloss to 10%
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default
@plq
plq / client.py
Last active Jul 11, 2018
Spyne Example
View client.py
from suds.client import Client
url = 'http://localhost:7789/?wsdl'
company = '2CA'
store = 1
password = '1234'
client = Client(url)
client.service.GetTicketList( 'company_name', 1, '1234' )
@plq
plq / helloworld_null.py
Created Oct 16, 2013
Spyne NullServer example.
View helloworld_null.py
'''
This is a simple HelloWorld example showing how the NullServer works. The
NullServer is meant to be used mainly for testing.
'''
import logging
logging.basicConfig(level=logging.INFO)
from pprint import pprint
@plq
plq / run.out
Last active Jun 8, 2017
Nuitka exception output
View run.out
plq@babe ~/src/github/plq/neurons/examples/garage $ (master) virtualenv virt-2.7
New python executable in /home/plq/src/github/plq/neurons/examples/garage/virt-2.7/bin/python2.7
Also creating executable in /home/plq/src/github/plq/neurons/examples/garage/virt-2.7/bin/python
Installing setuptools, pip, wheel...done.
plq@babe ~/src/github/plq/neurons/examples/garage $ (master) source virt-2.7/bin/activate
(virt-2.7) plq@babe ~/src/github/plq/neurons/examples/garage $ (master) python setup.py develop
running develop
running egg_info
writing requirements to garage.egg-info/requires.txt
View Makefile
randcoll: randcoll.cpp
g++ -g randcoll.cpp -std=c++11 -o randcoll
View wsdl.xml
<?xml version='1.0' encoding='utf-8'?>
<wsdl:definitions xmlns:plink="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:s0="www.example.com/schema/b" xmlns:soap11enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap11env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding" xmlns:soap12env="http://www.w3.org/2003/05/soap-envelope" xmlns:tns="www.example.com/schema/a" xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap11="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdlsoap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="www.example.com/schema/a" name="Application">
<wsdl:types>
<xs:schema targetNamespace="www.example.com/schema/b" elementFormDefault="qualified">
<xs:import namespace="www.example.com/schema/a"
@plq
plq / encoding.cpp
Created Jan 10, 2012
Qt ile encoding testi.
View encoding.cpp
#include <QString>
#include <QTextCodec>
#include <iostream>
int main(int argc, char *argv[]) {
const char *p = "kıracağım";
// Kaynak kod editörünün encoding'inin utf8 olduğunu varsayarsak;
QTextCodec *utf8 = QTextCodec::codecForName("utf8");
QTextCodec *cp_1254 = QTextCodec::codecForName("Windows-1254");
View pap.sh
pap() {
python -c "import $1" || exit 1;
echo $(dirname "$(python -c "import $1; print $1.__file__")"); #"
}
prp() {
retval="$1";
retval="$(pap "$retval")";
[ -z "$retval" ] && exit 1;
@plq
plq / metadata.xsd
Created Jan 27, 2016
Gentoo Schema
View metadata.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="packages">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="pkgmetadata"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="catmetadata">
@plq
plq / gallery.py
Last active Jan 4, 2016
serialization gallery
View gallery.py
You can’t perform that action at this time.