Skip to content

Instantly share code, notes, and snippets.

@DavidAce
DavidAce / nvidia-tdp.service
Last active April 16, 2024 05:49
Nvidia power limit at boot
[Unit]
Description=Set NVIDIA power limit above default
[Service]
Type=oneshot
ExecStartPre=/usr/bin/nvidia-smi -pm 1
ExecStart=/usr/bin/nvidia-smi -pl 275
@ryanmaclean
ryanmaclean / disable_k400r_tap_click.md
Last active April 16, 2024 05:47
Turn off Logitech k400r Tap to Click

Turn off k400r Tap to Click

Without even installing drivers, the Logitech k400r tap-to-click functionality can be turned off by holding down the "FN" (function) key and the left click button on the trackpad.

Source

@lopspower
lopspower / README.md
Last active April 16, 2024 05:46
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@Snarp
Snarp / google-docs-copy.js
Last active April 16, 2024 05:46
Script to allow copying from a protected Google Doc
/*
<https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc>
NOTE - 2021-05-24
-----------------
The script below isn't the fastest way to copy-and-paste from a protected
Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from
the comments:
@Klerith
Klerith / Dockerfile
Last active April 16, 2024 05:44
Preparar imagen de Docker - Node App
# Install dependencies only when needed
FROM node:18-alpine3.15 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Build the app with cache dependencies
FROM node:18-alpine3.15 AS builder
@dayitv89
dayitv89 / AWS_S3.md
Last active April 16, 2024 05:44
AWS S3 public read and a keys to write on the bucket

Create a backet without restriction and add policy to that as

Create Bucket:

AWS Console > Services > S3 (Storage) > Create Bucket >

Tab: Name And Region:

  1. give YOUR-BUCKET-NAME,
  2. select Region
  3. Tap on Next
@ftpmorph
ftpmorph / Details and config tips.txt
Last active April 16, 2024 05:44
Amazon AWS S3 IAM permissions required for Mastodon
When setting up a Mastodon instance I had a very hard time working out the required S3 permissions.
Wasted a day on it. None of the tutorials or even the official documentation gave me this information.
In the end I gave up and just gave it blanket access to all permissions for the Mastodon bucket (S3Administrator).
But this didn't set well with me - I don't like granting unnecessary permissions, especially not when S3 has about 100 of them.
If the server were to become compromised or the keys were to otherwise fall into the wrong hands I'd want a potentially malicious actor to have as limited permissions as possible.
Anyway I finally worked out the permissions required to for Mastodon to function with an S3 bucket as its media storage.
See below for the IAM policy.
const pw = require('playwright');
const UserAgent = require('user-agents');
const uuid = require('uuid');
const tmp = require('tmp-promise');
const UINT32_MAX = (2 ** 32) - 1;
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D
@alghanmi
alghanmi / get-plex-toekn.sh
Created August 27, 2019 16:34
Obtain Permanent Plex Token
curl -X POST \
-H 'X-Plex-Version: 0.3.0' \
-H 'X-Plex-Product: YOUR PRODUCT NAME' \
-H 'X-Plex-Client-Identifier: YOUR-PRODUCT-ID' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data-urlencode 'user[password]=PLEX_PASSWORD' \
--data-urlencode 'user[login]=PLEX_USERNAME' \
https://plex.tv/users/sign_in.json