Skip to content

Instantly share code, notes, and snippets.

// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/// @title Voting with delegation.
contract Ballot {
// This declares a new complex type which will
// be used for variables later.
// It will represent a single voter.
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title HelloWorld
* @dev Store & retrieve an unsigned integer in a variable
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts
*/
contract HelloWorld {
uint256 num;
@rajgoesout
rajgoesout / systemd-cloudwatch-logs-tutorial.md
Created February 12, 2021 09:48 — forked from adam-hanna/systemd-cloudwatch-logs-tutorial.md
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section:

@rajgoesout
rajgoesout / developing-on-filecoin.md
Created July 30, 2020 05:37 — forked from pooja/developing-on-filecoin.md
Developing on Filecoin: Resources
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
filteredBuilds: function() {
var filterKey = this.searchQ && this.searchQ.toLowerCase()
var fBuilds = this.builds
if (filterKey) {
fBuilds = fBuilds.filter(function(row) {
return Object.keys(row).some(function(key) {
if (key == 'properties') {
if (row[key]['fullportlist']) {
return (
String(row[key]['fullportlist'][0])
2019-07-01 21:03:50+0530 [-] GitHubPullrequestPoller: polling GitHub repository am1e/macports-ports, branches: None
2019-07-01 21:03:50+0530 [-] while polling for changes
Traceback (most recent call last):
File "/Users/rajdeep/goodbb/.venv/lib/python3.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
result = g.send(result)
File "/Users/rajdeep/goodbb/master/buildbot/changes/github.py", line 272, in poll
yield self._processChanges(result)
File "/Users/rajdeep/goodbb/.venv/lib/python3.7/site-packages/twisted/internet/defer.py", line 1613, in unwindGenerator
return _cancellableInlineCallbacks(gen)
File "/Users/rajdeep/goodbb/.venv/lib/python3.7/site-packages/twisted/internet/defer.py", line 1529, in _cancellableInlineCallbacks
2019-06-28 19:48:11+0530 [-] Starting factory <buildbot_worker.pb.BotFactory object at 0x11135da20>
2019-06-28 19:48:12+0530 [Broker,client] ReconnectingPBClientFactory.failedToGetPerspective
2019-06-28 19:48:12+0530 [Broker,client] unauthorized login; check worker name and password
2019-06-28 19:48:12+0530 [-] Scheduling retry 1 to connect <twisted.internet.endpoints.TCP4ClientEndpoint object at 0x11135dbe0> in 2.189634647637061 seconds.
2019-06-28 19:48:12+0530 [-] Stopping factory <buildbot_worker.pb.BotFactory object at 0x11135da20>
[{"name": "1password-cli"}, {"name": "2Pong"}, {"name": "3proxy"}, {"name": "4th"}, {"name": "54321"}, {"name": "6tunnel"}, {"name": "9e"}, {"name": "a2ps"}, {"name": "a2ps-j"}, {"name": "a52dec"}, {"name": "aacgain"}, {"name": "aalib"}, {"name": "aamath"}, {"name": "abcde"}, {"name": "abcl"}, {"name": "abclock"}, {"name": "abcm2ps"}, {"name": "abcMIDI"}, {"name": "abgx360"}, {"name": "abinit"}, {"name": "abiword"}, {"name": "abiword-x11"}, {"name": "abook"}, {"name": "abtransfers"}, {"name": "abyss"}, {"name": "accountsservice"}, {"name": "aces_container"}, {"name": "ack"}, {"name": "ackmate"}, {"name": "acl2"}, {"name": "acpica"}, {"name": "activewire"}, {"name": "add"}, {"name": "adns"}, {"name": "adodb"}, {"name": "ADOL-C"}, {"name": "adtpro"}, {"name": "advancecomp"}, {"name": "advancemame"}, {"name": "advancemenu"}, {"name": "advancescan"}, {"name": "advi"}, {"name": "adwaita-icon-theme"}, {"name": "aee"}, {"name": "aegis"}, {"name": "aesutil"}, {"name": "aewan"}, {"name": "aewm"}, {"name": "aff4"}, {"n
@rajgoesout
rajgoesout / Portfile
Last active April 15, 2019 13:14
buildbot-worker
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup python 1.0
name buildbot-worker
version 2.2.0
categories devel python
platforms darwin
supported_archs noarch