Skip to content

Instantly share code, notes, and snippets.

View selfagency's full-sized avatar
👾
beep boop

daniel sieradski selfagency

👾
beep boop
View GitHub Profile
@selfagency
selfagency / git-config.sh
Created August 10, 2023 20:53
[wsl -> windows git]
# This can be due to security features built into newer Git versions, which prevent WSL paths from being accessed by Git.
#There is a workaround, though: disabling the check for a specific directory or all:
git config --global --add safe.directory '%(prefix)///wsl.localhost/
git config --global --add safe.directory '*'
# After applying this you should be able to add the repo to Tower.
@selfagency
selfagency / ExecuteCommandOnRemoteServers.ps1
Created July 7, 2023 17:12
schedule remote windows tasks
# Set the command to execute on remote servers
$command = "YourCommandHere"
# Set the list of remote servers
$servers = "server1", "server2", "server3"
# Set the schedule for the task (every day at 8:00 AM)
$schedule = "0 8 * * *"
# Set the username and password for authentication on remote servers

openpgp4fpr:83dc1fc2373f0e2797f2c7812f4a8869e66811fd

@selfagency
selfagency / pre-push.sh
Created May 17, 2022 18:52
[Git hook to protect branch]
#!/bin/bash
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ $protected_branch = $current_branch ]
then
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty
echo
if echo $REPLY | grep -E '^[Yy]$' > /dev/null
@selfagency
selfagency / jl2j.sh
Last active February 23, 2022 21:25
Super-duper-simple JSON log to JSON converter
#!/bin/bash
####################################################
# Super-duper-simple JSON log to JSON converter #
# #
# Install: #
# $ curl $RAW_GIST_URL -o jl2j #
# $ chmod +x jl2j #
# $ sudo mv jl2j /usr/local/bin #
# #
@selfagency
selfagency / package.json
Last active February 2, 2022 23:44
[use google secret manager with strapi or any node application]
{
"name": "strapi",
"private": true,
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"develop": "strapi develop",
"start": "eval $(node src/secrets.js); strapi start",
"build": "strapi build",
"gcp-build": "strapi build",
@selfagency
selfagency / gae_version_cleanup.sh
Last active January 26, 2022 15:57
[google app engine version cleanup script]
#!/usr/bin/env bash
###########################################################
# Use this script to delete old versions of GAE services. #
# Requires gcloud SDK to be installed and authorized. #
# Usage: #
# GCP_PROJECT=my_project GAE_SERVICE=my_service KEEP=5 \ #
# ./gae_version_cleanup.sh #
###########################################################
@selfagency
selfagency / wp-config.php
Created July 11, 2021 01:18
[dotenv wp-config.php]
<?php
/** Enable W3 Total Cache */
define('WP_CACHE', true); // Added by W3 Total Cache
/* Load .env */
require_once 'public/vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
@selfagency
selfagency / vuex-subscribe.vue
Created July 11, 2021 01:18
[vuex subscribe]
<template>
<h1 v-if="status === 'success'">Success {{ complex.deep }}</h1>
<h1 v-else-if="status === 'error'">Error</h1>
<h1 v-else>Loading</h1>
</template>
<script>
import { mapState } from 'vuex';
export default {
@selfagency
selfagency / launch.json
Created July 11, 2021 01:17
[nuxt vscode debug config]
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "client: chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},