This file contains 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
const {parse, stringify} = require('flatted/cjs'); | |
/* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
This file contains 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
# install libglvnd | |
# if you saw error: | |
# An incomplete installation of libglvnd was found. Do you want to install a full copy of libglvnd? This will overwrite any existing libglvnd libraries. | |
apt-get install dh-autoreconf libxext-dev libx11-dev x11proto-gl-dev | |
git clone https://github.com/NVIDIA/libglvnd.git | |
cd libglvnd | |
./autogen.sh | |
./configure | |
make |
This file contains 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
let b = async function() { | |
throw "bad" | |
} | |
let a = async function() { | |
try { | |
return b(); | |
} catch (e) { | |
console.log(123) | |
} |
This file contains 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
netstat -nlp | grep 0.0.0.0:8080 | awk '{print $7}' | cut -d/ -f1 |
This file contains 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
Feb 14 01:34:00 staging-rh5 kernel: IPv6: eth0: IPv6 duplicate address fe80::44ae:f2ff:fe2d:2aed detected! | |
Feb 14 01:34:01 staging-rh5 systemd: Created slice user-0.slice. | |
Feb 14 01:34:01 staging-rh5 systemd: Starting user-0.slice. | |
Feb 14 01:34:01 staging-rh5 systemd: Started Session 484 of user root. | |
Feb 14 01:34:01 staging-rh5 systemd: Starting Session 484 of user root. | |
Feb 14 01:34:01 staging-rh5 logrotate: ALERT exited abnormally with [1] | |
Feb 14 01:34:01 staging-rh5 systemd: Removed slice user-0.slice. | |
Feb 14 01:34:01 staging-rh5 systemd: Stopping user-0.slice. | |
Feb 14 01:34:02 staging-rh5 kernel: XFS (dm-9): Mounting V5 Filesystem | |
Feb 14 01:34:02 staging-rh5 kernel: docker0: port 5(vethfdecd241) entered forwarding state |
This file contains 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
var co = require('co'), | |
Agenda = require('agenda'); | |
var check = function (queryName, checkCursor, done) { | |
console.log("1. this gets printed ..."); | |
co(function*() { | |
try { | |
console.log("2. this gets printed"); | |
const cursor = checkCursor; | |
for (let token = yield cursor.next(); token != null; token = yield cursor.next()) { |
This file contains 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
- shell: curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python | |
when: "{{ pip_version.stdout| ge_version('7.0.0') }} == False" | |
def ge_version(given, minimum_required): | |
if given == "": | |
return False | |
def versiontuple(v): | |
return tuple(map(int, (v.split(".")))) | |
This file contains 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 pacparser | |
import urllib2 | |
pac_url="" | |
response = urllib2.urlopen(pac_url) | |
f = open('proxy.pac', 'w') | |
f.write(response.read()) | |
f.close() | |
pacparser.init() |
This file contains 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
from ryu.base import app_manager | |
from ryu.controller import ofp_event | |
from ryu.controller.handler import MAIN_DISPATCHER | |
from ryu.controller.handler import CONFIG_DISPATCHER | |
from ryu.controller.handler import set_ev_cls | |
class L2Switch(app_manager.RyuApp): | |
def __init__(self, *args, **kwargs): | |
super(L2Switch, self).__init__(*args, **kwargs) |
This file contains 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
#!/usr/bin/ruby | |
require 'open-uri' | |
str = ARGV[0] | |
p str | |
puts URI::encode(str) |
NewerOlder