Skip to content

Instantly share code, notes, and snippets.

@TheIdealis
TheIdealis / pacman_revert.py
Last active October 30, 2022 13:18
A small script which is reverting my pacman upgrades from a specific date. (Nvidia ...) It is only downgrading the packages from a specific date so one might have to call the script several times.
#!/usr/bin/python
from subprocess import call
import re
from os.path import exists
from os import environ
home = environ['HOME']
reg_time = re.compile(r'\[(\d{4}.+\d{4})\]')
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active May 4, 2024 00:53
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@shijij
shijij / gist:54c9b21f26c08a15a70c182f03cb15b4
Created November 14, 2017 12:31
Nginx ssl reverse proxy with SNI
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourdomain
ssl_certificate /etc/ssl/localcerts/yourdomain.crt;
ssl_certificate_key /etc/ssl/localcerts/yourdomain.key;
ssl_ecdh_curve prime256v1;
ssl_session_cache builtin:1000 shared:SSL:10m;
@probonopd
probonopd / linux_fusion360.md
Last active November 9, 2023 15:22
Autodesk Fusion 360 on Linux

Autodesk Fusion 360 on Linux

In the Web Browser

Ubuntu, Fedora, openSUSE, CentOS, SUSE Linux Enterprise, Debian,... users can finally use Autodesk Fusion 360 in the Linux Browser now.

https://myhub.autodesk360.com

On Chromium 55.0.2843.0 I get NET::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED.

@hardfire
hardfire / README.MD
Last active August 12, 2021 03:34
using cgroups to limit browser memory+cpu usage
  1. cgconfig.conf - that's where you create the control group /etc/
  2. cgrules.conf - that's where you add binaries to that specific control group /etc/
  3. cgconf - that's the init script i use because its not available on ubuntu. It might be available for your OS in the package manager. I took the startup script from http://askubuntu.com/questions/836469/install-cgconfig-in-ubuntu-16-04 - /etc/init.d/

Notes

Use the following steps to test what you have without the

  • cgconfigparser -l /etc/cgconfig.conf - to add/register your control group to the system
  • cgrulesengd - sends the binary-cgroup binding rules.
@itzg
itzg / README libvirt cloud-init with static networking.md
Last active December 30, 2023 01:46
Configuring a libvirt domain with a static IP address via cloud-init local datasource

Here is how to create a cloud-init disk image and OS disk image suitable for configuring into a libvirt domain file.

In my case I am naming my domain (a.k.a. virtual machine or VM) xenial with a static IP address of 192.168.0.101. The filenames "network-config" and "user-data" files are arbitrary, so they can be named with a prefix for the domain, etc.

First, get the cloud image and convert into QCOW2 format:

qemu-img convert -O qcow2 xenial-server-cloudimg-amd64-disk1.img xenial-server-cloudimg-amd64-disk1.qcow2
# download source https://www.python.org/downloads/release/python-2712/
wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
tar -zxvf Python-2.7.12.tgz
cd Python-2.7.12
# install
./configure
make
sudo make install
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@alces
alces / mk_ansible_distro.sh
Last active May 31, 2023 17:43
Make portable Ansible distribution which can be installed on another host with the same Python version simply by un-tarring it in the same directory. Virtualenv is used during build stage, but isn't required on the target machine. Originally, written as Vagrant provision script but probably can be used outside Vagrant.
#!/bin/bash
ANSIBLE_ROOT=${ANSIBLE_ROOT:-/opt/ansible}
DISTR_ROOT=${DISTR_ROOT:-/vagrant}
yum install -y python-setuptools python-devel libffi-devel openssl-devel
easy_install virtualenv
virtualenv "$ANSIBLE_ROOT"
. "$ANSIBLE_ROOT/bin/activate"
# PY_LIBS can contain a space-separated list of Python libraries your playbooks require to run (e.g., "dnspython shade")
@lilongen
lilongen / run-ansible-with-any-host-without-inventory
Last active May 5, 2023 23:16
How to run Ansible without specifying the inventory but the host directly?
Question:
. How to run Ansible without specifying the inventory but the host directly?
. Run a playbook or command with arbitrary host not in the inventory hosts list?
. run ansible with arbitrary host/ip without inventory?
Answer:
Surprisingly, the trick is to append a ,
The host parameter preceding the , can be either a hostname or an IPv4/v6 address.
ansible all -i example.com,