Skip to content

Instantly share code, notes, and snippets.

View jjasghar's full-sized avatar

JJ Asghar jjasghar

View GitHub Profile
@cloudnull
cloudnull / install-n-start-tmate.sh
Last active September 6, 2022 17:47
Install the latest static tmate and start a session
TMATE_FILE=$($(command -v python3 || command -v python) <<EOC
import requests
r = requests.get(
'https://api.github.com/repos/tmate-io/tmate/releases/latest'
)
releases = r.json()
amd64_releases = [
i for i in releases['assets']
if 'amd64' in i['name'] and not 'dbg' in i['name']
][0]
@corentinbettiol
corentinbettiol / README.md
Last active January 13, 2021 19:14
Homemade timetracking in its simplest form.

What ?

It's a very simple timetracking tool for linux users that use systemd services & zenity.

screenshot (source)

How to install

  1. Put timetracking.sh on your computer.
@IanColdwater
IanColdwater / twittermute.txt
Last active April 3, 2024 19:43
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@tmckayus
tmckayus / remote_crc.md
Last active April 2, 2024 12:13
Running 'crc' on a remote server

Overview: running crc on a remote server

This document shows how to deploy an OpenShift instance on a server using CodeReady Containers (crc) that can be accessed remotely from one or more client machines (sometimes called a "headless" instance). This provides a low-cost test and development platform that can be shared by developers. Deploying this way also allows a user to create an instance that uses more cpu and memory resources than may be available on his or her laptop.

While there are benefits to this type of deployment, please note that the primary use case for crc is to deploy a local OpenShift instance on a workstation or laptop and access it directly from the same machine. The headless setup is configured completely outside of crc itself, and supporting a headless setup is beyond the mission of the crc development team. Please do not ask for changes to crc to support this type of deployment, it will only cost the team time as they politely decline :)

The instructions here were tested with F

@johnie
johnie / README.md
Last active January 25, 2024 16:23
Filter Phish – This Google Apps Scripts filter will automatically move all future emails with the header `X-PHISHTEST` to trash.

Filter Phish

This Google Apps Scripts filter will automatically move all future emails with the header X-PHISHTEST to trash.

Getting started

  1. Go to Google Apps Script
  2. Add a new script and copy paste the content from the sibling file
  3. Test run the script, go to View in the menu bar and click Logs
  • If there's no errors it should be blank, OR a verbose message that it removed a phishing email.
@dlaptev
dlaptev / push_notifications_to_telegram.md
Last active April 17, 2024 12:23
Programmatically send push notifications to telegram from python
  1. Create a new Telegram bot:
    1. start a chat with BotFather;
    2. type /newbot, select a name (to be shown in chats) and handle for your bot;
    3. note the bot token to access HTTP API - a long string with a colon in the middle (later referred to as <token>);
    4. optionally /setdescription and /setuserpic.
  2. Add the bot to the chat/channel and note its id:
    1. add the bot to a new or existing chat or group - this is where your bot will send notifications to;
    2. go to https://api.telegram.org/bot<token>/getUpdates (replace <token> with your token);
    3. within the chat part, find and note the id field - a positive or negative number (later referred to as <chat_id>).
  3. Programmatically send notifications:
@brianshumate
brianshumate / docker-macos-terraform.md
Last active April 16, 2024 02:18
The Simplest Terraform with Docker on macOS

If you'd like to experiment with Terraform on macOS locally, a great provider for doing so is the Docker provider. You can get set up in a few simple steps, like so:

1. Install Docker

Install Docker for Mac if you have not already.

@donniebishop
donniebishop / pokestat.py
Last active December 27, 2019 10:51
i3-blocklet for checking Pokemon Go status
#!/usr/bin/env python3
from bs4 import BeautifulSoup
import requests
POKEURL = 'http://cmmcd.com/PokemonGo/'
r = requests.get(POKEURL)
try:
import lxml
@camdez
camdez / breaktime.el
Last active August 29, 2015 14:28
/u/joeheyming's Emacs break timer (modified)
;;; See: https://www.reddit.com/r/emacs/comments/3icpo7/take_a_break_every_3_hours/
(defvar breaktime-timer nil
"Holds the running break timer (if any).")
(defvar breaktime-interval (* 3 60 60)
"How often to take a break, in seconds.")
(defun breaktime--take-a-break ()
(interactive)
(switch-to-buffer (get-buffer-create "*breaktime*"))
(let ((inhibit-read-only t))
@galenemery
galenemery / Winrm_setup.ps1
Last active February 9, 2020 05:24
WinRM config
# On the remote node/server:
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
# When NOT USING a domain-based authentication (i.e., from Linux/Unix to Windows node):
winrm set winrm/config/service/auth '@{Basic="true"}'