Skip to content

Instantly share code, notes, and snippets.

#inp = [2, 4, 1, 2, 3, 10, 13, 11, 7,6, 5,4,2,6,7,5,4,2]
inp = [5, 4, 1, 2, 3, 10, 13, 11, 3]
minv=1
posn=0
temp = min(inp)
res = [i for i, j in enumerate(inp) if j == temp]
out = [0]*len(inp)
out[res[0]]=1
User privilege specification
root ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
www-data ALL = (root) NOPASSWD:/sbin/ip
#includedir /etc/sudoers.d
root@raspberrypi:~#
#!/bin/sh
MODEM_IP="192.168.1.1"
curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml
COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147`
TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41`
#curl -X GET "http://$MODEM_IP/api/monitoring/status" \
curl -X POST "http://$MODEM_IP/api/device/control" \
-H "Cookie: $COOKIE" -H "__RequestVerificationToken: $TOKEN" \
Step 24/25 : RUN cd /src && wine64 /wine/drive_c/Python37/Scripts/pyinstaller.exe --onefile /src/gui.py
---> Running in f224ccae0473
3216 INFO: PyInstaller: 3.5
3217 INFO: Python: 3.7.1
3517 INFO: Platform: Windows-XP-5.1.2600
3606 INFO: wrote Z:\src\gui.spec
3620 INFO: UPX is not available.
3623 INFO: Extending PYTHONPATH with paths
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
ARG WINE_VERSION=winehq-staging
ARG PYTHON_VERSION=3.7.1
ARG PYINSTALLER_VERSION=3.5
# we need wine for this all to work, so we'll use the PPA
RUN set -x \
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
ARG WINE_VERSION=winehq-staging
ARG PYTHON_VERSION=3.7.1
ARG PYINSTALLER_VERSION=3.5
# we need wine for this all to work, so we'll use the PPA
RUN set -x \
@5ghz
5ghz / freedesktop.org_icons_with_descriptions.txt
Created September 30, 2019 06:13 — forked from peteristhegreat/freedesktop.org_icons_with_descriptions.txt
QIcon::fromTheme, List of icons in gnome theme, in qt standardPixmaps and list on freedesktop.org
# https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html, aggregate list from each section
address-book-new The icon used for the action to create a new address book.
application-exit The icon used for exiting an application. Typically this is seen in the application's menus as File->Quit.
appointment-new The icon used for the action to create a new appointment in a calendaring application.
call-start The icon used for initiating or accepting a call. Should be similar to the standard cellular call pickup icon, a green handset with ear and mouth pieces facing upward.
call-stop The icon used for stopping a current call. Should be similar to the standard cellular call hangup icon, a red handset with ear and mouth pieces facing downward.
contact-new The icon used for the action to create a new contact in an address book application.
document-new The icon used for the action to create a new document.
document-open The icon used for the action to open a document.
document-open-recent T
# -*- coding: utf-8 -*-
from __future__ import print_function
import binascii,socket,struct
from dnslib import DNSRecord,RCODE
from dnslib.server import DNSServer,DNSHandler,BaseResolver,DNSLogger
from dnslib.proxy import ProxyResolver, PassthroughDNSHandler
The following NEW packages will be installed:
cmake cmake-data libcurl4 libjsoncpp1 librhash0 libuv1
0 upgraded, 6 newly installed, 0 to remove and 153 not upgraded.
Need to get 0 B/4677 kB of archives.
After this operation, 24.3 MB of additional disk space will be used.
proot info: pid 5383: translate("/" + "/var/cache/apt/archives/")
proot info: pid 5383: -> "/home/unknown/tegra_linux/var/cache/apt/archives/"
proot info: pid 5383: translate("/" + "/var/log/apt/")
proot info: pid 5383: -> "/home/unknown/tegra_linux/var/log/apt/"
proot info: pid 5383: translate("/" + "/var/log/apt/eipp.log.xz")
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
from pyqtgraph.ptime import time
import serial
import random