Skip to content

Instantly share code, notes, and snippets.

View Dviejopomata's full-sized avatar
🏠
Working from home

Dviejo Dviejopomata

🏠
Working from home
  • Alicante, Spain
View GitHub Profile
@Dviejopomata
Dviejopomata / main.kt
Created October 4, 2018 12:01
Show android notification with alarm sound
val textTitle = "Title"
val textContent = "Content"
val alarmSound = Settings.System.DEFAULT_ALARM_ALERT_URI
val mBuilder = NotificationCompat.Builder(this, "alarm-1")
.setSmallIcon(R.drawable.navigation_empty_icon)
.setContentTitle(textTitle)
.setContentText(textContent)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setSound(alarmSound, AudioManager.STREAM_ALARM)
POST /main.fbddd1fc85fb802220eb.js HTTP/1.1
Host: frontend-ng.nextagilesoft.com
CONTENT
IP=$1
PORT=$2
echo "Waiting for $IP to be accesible on $PORT..."
while ! nc -z $IP $PORT; do
sleep 0.5
done
notify-send "Server $IP is up"
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.OpenSsl;
using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using X509Certificate = Org.BouncyCastle.X509.X509Certificate;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
@Dviejopomata
Dviejopomata / cmds-openssl.md
Last active September 19, 2018 15:41
Openssl common certificates

Der to pem

openssl x509 -inform der -in file.cer -out file.pem

Pem to der

openssl x509 -in file.pem -out file.cer -outform der
app: printv3
company: nextagilesoft
config: {}
dependencies:
postgresql:
version: 10.6
handlers:
package build
import (
"context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/builder/dockerignore"
"github.com/docker/docker/builder/remotecontext/git"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/idtools"
@Dviejopomata
Dviejopomata / docker-compose.yml
Last active September 5, 2018 09:28
Postgres master slave
version: '3'
services:
pg-master:
restart: always
image: sameersbn/postgresql:10
volumes:
- pg-master:/var/lib/postgresql
ports:
- "5434:5432"
const fs = require('fs');
const readline = require('readline');
const { google } = require('googleapis');
// codigo de acceso 4/SQBCzOPQn-xHeDBJ3j1LmaSNxP7Hlk62BvrZoPBUk3KgVCqSqvP2ezQ
// If modifying these scopes, delete token.json.
const SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly'];
const TOKEN_PATH = 'token.json';
// Load client secrets from a local file.
fs.readFile('credentials.json', (err, content) => {
cat <<EOF | kubectl create -f -
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard
labels:
k8s-app: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io