Skip to content

Instantly share code, notes, and snippets.

Avatar

Victor vspedr

  • Campinas, Brazil
View GitHub Profile
View Fix Spotify stuck in full screen (Ubuntu 18.04.01) installed from snap
Problem:
I experienced Spotify being stuck in full screen mode.
The title bar with minimize, maximize and close wasn't present and no keyboard shortcut I know about would exit full screen.
Solution
rm ~/snap/spotify/current/.config/spotify/prefs
Works both in 18.04.01 and 20.04.x
Source:
View gist:324c8f453bb2733aa5ce32b97aa92afd
docker run -d --restart unless-stopped --name openldap \
-p 389:389 \
-e DEBUG_LEVEL=1 \
-e DOMAIN=my-company.com \
-e ORGANIZATION="My Company" \
-e PASSWORD=1234 \
mwaeckerlin/openldap
View cron_open_browser
crontab -l | { cat; echo "0 11 * * * export DISPLAY=:0 && google-chrome https://google.com"; } | crontab -
View gist:29b91e73f0cb77c3c6a3cb0599c06565
Using sudo is a great way to make things happen, but most people neglect to understand everything that happens when sudo is used. Particularly with npm, and npm modules, using sudo can result in things being performed by root which the user doesn't want to have be performed by root, such as file creation or use of protected ports. Basically, the "use sudo" advice falls flat on its face (perhaps after stumbling and staring into the sun for a moment) where nvm/npm/node is concerned. – bschlueter Aug 1 '16 at 22:43
@vspedr
vspedr / logger.js
Last active May 10, 2018
winston + morgan logging middleware
View logger.js
import config from '../config';
import winston from 'winston';
const logger = new (winston.Logger)({
level: config.log.level,
transports: [
new winston.transports.Console({
colorize: true,
timestamp: true,
})
@vspedr
vspedr / keycloak-docker.txt
Last active Mar 1, 2018
Keycloak docker themes
View keycloak-docker.txt
docker run -e KEYCLOAK_USER=<USERNAME> -e KEYCLOAK_PASSWORD=<PASSWORD> -e DB_VENDOR=H2 -p 8080:8080 jboss/keycloak
docker cp <CONTAINERID>:/opt/jboss/keycloak/themes ~/keycloak-themes
@vspedr
vspedr / grafana.md
Last active Jan 30, 2018
Grafana + Graphite + statsd + docker getting started
View grafana.md

This provides a minimal setup for running grafana, graphite and statsd in docker containers for experimenting. Not suitable for production environment as additional security configuration is required.

Assuming you have docker installed and ready for use:

  1. Run official grafana image:
docker run -d -p 3000:3000 grafana/grafana
View ReadDeviceToCloud.js
// based on: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-node-node-getstarted#receive-device-to-cloud-messages
const EventHubClient = require('azure-event-hubs').Client;
const connectionString = '{iothub connection string}';
const printError = (err) => {
console.err(err.message);
}
const printMessage = (message) => {
View CreateDeviceIdentity.js
// based on: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-node-node-getstarted#create-a-device-identity
const iothub = require('azure-iothub');
const connectionString = '{iothub connection string}';
const registry = iothub.Registry.fromConnectionString(connectionString);
const device = {
deviceId: 'myFirstNodeDevice'
};
registry.create(device, function(err, deviceInfo, res) {
@vspedr
vspedr / learning.md
Last active Jan 23, 2018 — forked from sibelius/learning.md
Learning Path React Native
View learning.md

Basics

  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
  • Learn how to use fetch to get data from your backend

Learn Navigation