Skip to content

Instantly share code, notes, and snippets.

View sanfx's full-sized avatar
🎯
Focusing

Sanjeev Kumar sanfx

🎯
Focusing
  • Northampton
  • 15:53 (UTC)
View GitHub Profile
@sanfx
sanfx / fetch.py
Last active September 18, 2022 13:28 — forked from syndbg/fetch.py
A small Python script, that fetches a YouTube playlist's videos titles and writes them to a file playlist.txt in the same directory. Usage? A legal backup against video deletion. You could always find the song if you know the song title before it got removed
import gdata.youtube
import gdata.youtube.service
# Dependencies:
# - Python==3.10
# - gdata-python3==2.0.18
# - google-api-python-client==1.2
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
@sanfx
sanfx / docker.cadvisor.service
Created August 6, 2020 17:53 — forked from pa-re/docker.cadvisor.service
/etc/systemd/system/docker.cadvisor.service
sudo docker create \
-v /:/rootfs:ro \
-v /var/run:/var/run:rw \
-v /sys:/sys:ro \
-v /var/lib/docker/:/var/lib/docker:ro \
-p 49876:8080 \
--name=cadvisor \
google/cadvisor:latest
sudo echo "[Unit]
@sanfx
sanfx / vncserver@:1.service
Created July 31, 2020 15:17 — forked from spinxz/vncserver@:1.service
systemd service file for running a vncserver (e.g. tightvncserver)
# Vncserver service file for Debian or Ubuntu with systemd
#
# Install vncserver and tools
# e.g. apt-get install tightvncserver autocutsel gksu
#
# 1. Copy this file to /etc/systemd/system/vncserver@:1.service
# 2. Edit User=
# e.g "User=paul"
# 3. Edit the vncserver parameters appropriately in the ExecStart= line!
# e.g. the -localhost option only allows connections from localhost (or via ssh tunnels)
@sanfx
sanfx / TempSensor.h
Created October 26, 2019 18:41 — forked from dmiddlecamp/TempSensor.h
OneWire Temp - Multiple Sensors
#include "application.h"
class TempSensor {
public:
char *id ;
uint8_t rom[8];
float value ;
int updated ;
};
@sanfx
sanfx / devpi-server-article.md
Created May 28, 2018 16:49 — forked from chronossc/devpi-server-article.md
Article/how to about how install devpy-server (not finished yet)

dev-pi install howto

This guide follow instructions in the devpi quickstart server guide. We will install in own user home using virtualenvs, than, will setup a nginx instance. Server used here is Ubuntu Server 12.04 LTS in one virtualbox instance.

Create devpi user

root ~ # useradd -m -U -s /bin/bash devpi
root ~ # passwd devpi
@sanfx
sanfx / Galaxy Of Tutorial Torrents
Created September 25, 2017 19:47 — forked from iHassan/Galaxy Of Tutorial Torrents
Ultimate Galaxy Of Tutorial Torrents
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
@sanfx
sanfx / geonames.py
Created July 31, 2017 08:49 — forked from pamelafox/geonames.py
Geonames Python wrapper
import sys
import urllib
import urllib2
import json
import logging
class GeonamesError(Exception):
def __init__(self, status):
@sanfx
sanfx / custom_ui_docked.py
Last active July 25, 2017 07:26 — forked from fredrikaverpil/custom_ui_docked.py
Create custom PySide GUI and dock it into Nuke UI
import PySide.QtCore as QtCore
import PySide.QtGui as QtGui
from nukescripts import panels
## https://docs.thefoundry.co.uk/nuke/70/pythonreference/nukescripts.panels-module.html
class PanelTest(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setLayout(QtGui.QVBoxLayout())
@sanfx
sanfx / backup_script.py
Created June 9, 2017 18:08 — forked from jvkersch/backup_script.py
Python wrapper around to rsync to facilitate backup
#!/usr/bin/env python
"""
A simple wrapper around rsync for backup.
Usage: create a text file with on each line a resource that you wish to
backup. Paths should be relative to the user's home directory. Entries
starting with '#' are ignored, as are blank lines. Call this script via
python backup_script.py -i [backup_files.txt] [rsync_target_folder]