Same as QObject List Model but with a factory function and arbitrary keys.
See also
| # -*- coding: utf-8 -*- | |
| # Form implementation generated from reading ui file 'design.ui' | |
| # | |
| # Created: Wed May 27 16:39:17 2015 | |
| # by: PyQt4 UI code generator 4.11.3 | |
| # | |
| # WARNING! All changes made in this file will be lost! | |
| from PyQt4 import QtCore, QtGui |
| #!/bin/bash | |
| # first login and store the cookie | |
| wget --post-data='name=USERNAME&pass=PASSWORD&op=Log%20in' --save-cookies=my-cookies.txt --keep-session-cookies "https://private.site.com" > /dev/null 2>&1 | |
| # now we can scrape the site (353 pages) | |
| for i in {0..353} | |
| do | |
| echo "grabbing page $i..." | |
| wget --cookies=on --keep-session-cookies --load-cookies=my-cookies.txt "https://private.site.com/people?page=$i" > /dev/null 2>&1 |
| cmake_minimum_required(VERSION 3.5) | |
| project(myproject) | |
| set(SOURCE_FILES src/main.cpp) | |
| add_executable(myproject ${SOURCE_FILES}) | |
| set_target_properties(${PROJECT_NAME} PROPERTIES VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6") | |
| set_target_properties(${PROJECT_NAME} PROPERTIES VS_DOTNET_REFERENCES "System") | |
| set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/clr /EHa") | |
| string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | |
| string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") |
| #!/bin/bash | |
| # | |
| # the basic idea from https://gist.github.com/vishvananda/7094676 | |
| # | |
| # if [ "$4" == "" ]; then | |
| # echo "usage: $0 <local_ip> <remote_ip> <new_local_ip> <new_remote_ip>" | |
| # echo "creates an ipsec tunnel between two machines" | |
| # exit 1 |
| /Library/Application\ Support/VMware\ Fusion/vmrun | |
| vmrun version 3.1.1 build-282344 | |
| Usage: vmrun [AUTHENTICATION-FLAGS] COMMAND [PARAMETERS] | |
| AUTHENTICATION-FLAGS | |
| -------------------- |
| #!/bin/python | |
| # -*- coding: utf-8 -*- | |
| # I found the interface id is not a fixed value... | |
| import subprocess | |
| INTERFACE = "tincvpn" | |
| ROUTE = "route add 10.0.0.0 mask 255.0.0.0 192.168.102.199 metric 1 if %s" | |
| def get_interface_id(): | |
| interfaces = subprocess.check_output("netsh int ipv4 show interfaces") |
| <?xml version="1.0" encoding="utf-8"?> | |
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a ="http://microsoft.com/schemas/VisualStudio/TeamTest/2006" xmlns:b ="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" > | |
| <xsl:output method="xml" indent="yes" /> | |
| <xsl:template match="/"> | |
| <testsuites> | |
| <xsl:variable name="buildName" select="//a:TestRun/@name"/> | |
| <xsl:variable name="numberOfTests" select="count(//a:UnitTestResult/@testId) + count(//b:UnitTestResult/@testId)"/> | |
| <xsl:variable name="numberOfFailures" select="count(//a:UnitTestResult/@outcome[.='Failed']) + count(//b:UnitTestResult/@outcome[.='Failed'])" /> | |
| <xsl:variable name="numberOfErrors" select="count(//a:UnitTestResult[not(@outcome)]) + count(//b:UnitTestResult[not(@outcome)])" /> | |
| <xsl:variable name="numberSkipped" select="count(//a:UnitTestResult/@outcome[.!='Passed' and .!='Failed']) + count(//b:UnitTestResult/@outcome[.!='Passed' and .!='Failed'])" /> |
Same as QObject List Model but with a factory function and arbitrary keys.
See also
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| """ | |
| python_3_email_with_attachment.py | |
| Created by Robert Dempsey on 12/6/14. | |
| Copyright (c) 2014 Robert Dempsey. Use at your own peril. | |
| This script works with Python 3.x | |
| NOTE: replace values in ALL CAPS with your own values |
| apt install wget -y | |
| wget https://boot.netboot.xyz/ipxe/netboot.xyz.lkrn -O /netboot.xyz.lkrn | |
| cat >> /etc/grub.d/40_custom <<EOF | |
| #/etc/grub.d/40_custom | |
| menuentry "netboot.xyz.lkrn" { | |
| linux16 (hd0,msdos1)/netboot.xyz.lkrn # /boot is (hd0,msdos1) drive | |
| } | |
| EOF | |
| grub2-mkconfig -o /boot/grub2/grub.cfg | |
| grub-mkconfig -o /boot/grub/grub.cfg |