Skip to content

Instantly share code, notes, and snippets.

@marcw
marcw / ln-connect-to-onion-peers.sh
Created February 13, 2019 23:07
Connect to all tor onion peers in the lightning network node graph. It works on a Raspiblitz v0.99! :)
#!/bin/bash
lncli describegraph | jq '.nodes[] | select(.addresses[].addr | contains("onion")) | .pub_key + "@" + .addresses[0].addr' | xargs -L1 lncli connect
### Keybase proof
I hereby claim:
* I am marcw on github.
* I am de_la_tech (https://keybase.io/de_la_tech) on keybase.
* I have a public key ASCGlP8VOU_37UzSFnt8SgPKLeP_OZ5zWEcFemdeoCbdvQo
To claim this, I am signing this object:
@marcw
marcw / server.conf
Created January 22, 2018 18:17
Nginx configuration to serve a Symfony app under a subdirectory of a PHP application
# With this nginx configuration, you will be able to serve a Symfony app in a subdirectory
# of a wordpress (or any other PHP application).
server {
listen 80;
listen [::]:80;
server_name mysite.com;
root /var/www/wordpress;
index index.php app.php index.html;
<?php
namespace AudienceHero\Bundle\FileBundle\Action;
use ApiPlatform\Core\Bridge\Symfony\Validator\Exception\ValidationException;
use AudienceHero\Bundle\FileBundle\Entity\File;
use AudienceHero\Bundle\FileBundle\Factory\FileFactory;
use AudienceHero\Bundle\FileBundle\Uploader\UploaderInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
CREATE SEQUENCE seq_aliases_pkid;
CREATE TABLE IF NOT EXISTS aliases (
pkid INT NOT NULL DEFAULT nextval('seq_aliases_pkid'),
mail VARCHAR(120) NOT NULL default '',
destination VARCHAR(120) NOT NULL default '',
enabled BOOLEAN NOT NULL default true,
PRIMARY KEY (pkid)
);
@marcw
marcw / deploy.sh
Created September 9, 2016 13:52
Symfony deployment bash script
#!/bin/bash
# some configurations values
host="foobar-web00" # the name of the host in my ssh config file
project_path="/var/www/foobar"
user="web"
key_filename="/path/to/.ssh/web-deploy-key"
dry_run="--dry-run"
assets_differ=""
{
"name": "marcw/foo-project",
"license": "proprietary",
"type": "project",
"description": "",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/moprodotio/Sitemap"
}
#!/bin/bash
sudo apt-get install -qy build-essential g++ flex bison gperf ruby perl libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libpng-dev libjpeg-dev python libx11-dev libxext-dev
sudo apt-get install -qy ttf-mscorefonts-installer
git clone --recurse-submodules git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 2.0.0
./build.py
sudo mv bin/phantomjs /usr/local/bin/phantomjs
packer build packer/template-virgin.json
2013/11/12 12:11:00 Packer Version: 0.4.0 dev f8dbe5246c9ce24f2bef0a2ef92fe78392d331d3
2013/11/12 12:11:00 Packer Target OS/Arch: linux amd64
2013/11/12 12:11:00 Built with Go Version: go1.1.2
2013/11/12 12:11:00 Detected home directory from env var: /var/lib/jenkins
2013/11/12 12:11:00 Attempting to open config file: /var/lib/jenkins/.packerconfig
2013/11/12 12:11:00 File doesn't exist, but doesn't need to. Ignoring.
2013/11/12 12:11:00 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot amazon-instance:packer-builder-amazon-instance digitalocean:packer-builder-digitalocean docker:packer-builder-docker openstack:packer-builder-openstack qemu:packer-builder-qemu virtualbox:packer-builder-virtualbox vmware:packer-builder-vmware] Commands:map[build:packer-command-build fix:packer-command-fix inspect:packer-command-inspect validate:packer-command-validate] PostProcessors:map[vagrant:
packer build packer/template-virgin.json
2013/11/12 11:50:33 Packer Version: 0.3.11
2013/11/12 11:50:33 Packer Target OS/Arch: linux amd64
2013/11/12 11:50:33 Detected home directory from env var: /var/lib/jenkins
2013/11/12 11:50:33 Attempting to open config file: /var/lib/jenkins/.packerconfig
2013/11/12 11:50:33 File doesn't exist, but doesn't need to. Ignoring.
2013/11/12 11:50:33 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot amazon-instance:packer-builder-amazon-instance digitalocean:packer-builder-digitalocean openstack:packer-builder-openstack virtualbox:packer-builder-virtualbox vmware:packer-builder-vmware] Commands:map[build:packer-command-build fix:packer-command-fix inspect:packer-command-inspect validate:packer-command-validate] PostProcessors:map[vagrant:packer-post-processor-vagrant] Provisioners:map[ansible-local:packer-provisioner-ansible-local chef-solo:packer-provisioner-chef-solo file:packer-p