Skip to content

Instantly share code, notes, and snippets.

@marvin
marvin / iescreenshot.php
Created July 19, 2012 08:19
PHP code to run on windows to access IE and make a screenshot of it
<?php
$browser = new COM("InternetExplorer.Application");
$browser->Fullscreen = true;
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://staticfloat.com");
/* Timeout? */
while ($browser->Busy) {
@marvin
marvin / install_duplicati_ubuntu20.sh
Created November 12, 2021 13:00
install duplicati in ubuntu 20
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install mono-devel gtk-sharp2 libappindicator0.1-cil libmono-2.0-1 -y
sudo apt install apt-transport-https nano git-core software-properties-common dirmngr -y
# nixos config for camus thinkpad T430s Laptop
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
@marvin
marvin / upgrade_Proxmox_5.4_to_7_without_CEPH.sh
Created October 22, 2021 18:55
Upgrade list to upgrade proxmox 5.4 via version 6 to version 7
proxmox upgrade from 5.4 to 7 without CEPH
## 5to6
systemctl stop pve-ha-lrm
systemctl stop pve-ha-crm
echo "deb http://download.proxmox.com/debian/corosync-3/ stretch main" > /etc/apt/sources.list.d/corosync3.list
apt update
apt dist-upgrade --download-only
apt dist-upgrade
@marvin
marvin / update_hosts.sh
Last active October 19, 2021 10:53
update hosts file on ubuntu with StevenBlack Hosts-List for porn+gamblin
#!/bin/bash
# uses gambling+porn from https://github.com/StevenBlack/hosts
# can be ran via cron
cd ~
wget https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts -O /tmp/hosts
sudo sed -i '/#DELETE/Q' /etc/hosts
echo '#DELETE' | sudo tee -a /etc/hosts
cat /tmp/hosts |sudo tee -a /etc/hosts
@marvin
marvin / zabbix_agent2.service
Last active October 4, 2021 10:42
centos7 Zabbix_agent2 Systemd Service Config
# install under /etc/systemd/system/zabbix_agent2.service
[Unit]
Description=Zabbix Agent 2
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent
Type=simple
#!/bin/bash
# _ __ _
# ((-)).--.((-))
# / '' \
# ( \______/ )
# \ ( ) /
# / /~~~~~~~~\ \
# /~~\/ / \ \/~~\
# ( ( ( ) ) )
# \ \ \ \ / / / /
@marvin
marvin / guessingGame.cpp
Created July 1, 2012 22:38
c++ guessing game
// guessingGame.cpp: David Noelte
// Description: The player has to guess the secret number and he got 10 attempts
#include <iostream>
#include <time.h>
using namespace std;
int main() {
// initialize random seed
srand(time(NULL));
@marvin
marvin / gist:7214039
Created October 29, 2013 12:48
pf outbound load balancing
lan_net = "192.168.0.0/24"
int_if = "dc0"
ext_if1 = "fxp0"
ext_if2 = "fxp1"
ext_gw1 = "68.146.224.1"
ext_gw2 = "142.59.76.1"
# nat outgoing connections on each internet interface
match out on $ext_if1 from $lan_net nat-to ($ext_if1)
match out on $ext_if2 from $lan_net nat-to ($ext_if2)
@marvin
marvin / kevin_configuration.nix
Last active January 18, 2020 15:55
nixos - kevin config (work pc)
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix