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
architecture: "x86_64" | |
creation_date: 1581238800 | |
properties: | |
architecture: "x86_64" | |
description: "Debian Unstable (sid) with preinstalled Splunk Enterprise v8.0.2" | |
os: "debian" | |
release: "sid" |
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
Get-Content input.txt | Foreach-Object { | |
$item = invoke-webrequest https://www.rdap.net/ip/$_ | convertfrom-json; | |
$item | Add-Member -MemberType NoteProperty -Name "ipaddr" -Value "$_"; | |
$item.PSObject.Properties.Remove("entities"); | |
$item.PSObject.Properties.Remove("links"); | |
$item.PSObject.Properties.Remove("notices"); | |
$item | convertto-json; | |
} |
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
[ tsv_custom ] | |
CHARSET=UTF-8 | |
INDEXED_EXTRACTIONS=csv | |
KV_MODE=none | |
SHOULD_LINEMERGE=false | |
category=Structured | |
description=Tab-separated value format. Set header and other settings in "Delimited Settings" | |
disabled=false | |
pulldown_type=true | |
LINE_BREAKER=([\r\n]+) |
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
# -*- coding: utf-8 -*- | |
# | |
# Update an article via Qiita API | |
# Require: requests and toml (via pip) | |
# | |
import sys | |
import os | |
import logging | |
import json | |
import toml |
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
#include <stdio.h> | |
int main(void) { | |
printf("%s\n", tmpfile()); | |
return 0; | |
} |
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 urllib | |
import urllib2 | |
import urlparse | |
import json | |
def get(url, headers=None, params=None): | |
if params is not None: | |
query = urllib.urlencode(params) | |
url = '%s?%s' % (url, query) | |
req = urllib2.Request(url, headers=headers) |
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
#!/bin/sh | |
API_URL="https://talaikis.com/api/quotes/random/" | |
curl -XGET "$API_URL" | sed -e "s/{/{\"timestamp\":`date '+%s'`,/" |
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 requests | |
import os | |
apikey = os.environ['TWITTER_TOKEN'] | |
BASE_URL = 'https://api.twitter.com/1.1/search/tweets.json' | |
def get_tweets(query, apikey, base_url=BASE_URL, next_results=None): | |
headers = {"Authorization": "Bearer {key}".format(key=apikey)} | |
if next_results is None: | |
url = base_url | |
params = {'q': query} |
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 requests | |
from requests.auth import HTTPBasicAuth | |
import urllib | |
class Twitter(object): | |
def _access_token(self, key, secret): | |
r = requests.post('https://api.twitter.com/oauth2/token', | |
auth=HTTPBasicAuth(key, secret), | |
headers={'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, | |
data={'grant_type':'client_credentials'}) |
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
NAME := my_go_program | |
VERSION := $(shell git describe --tags) | |
REVISION := $(shell git rev-parse --short HEAD) | |
SRCS := $(shell find . -type f -name '*.go') | |
LDFLAGS := -ldflags="-s -w -X \"main.Version=$(VERSION)\" -X \"main.Revision=$(REVISION)\" -extldflags \"-static\"" | |
all: bin/$(NAME) dist | |
bin/$(NAME): $(SRCS) |
NewerOlder