Skip to content

Instantly share code, notes, and snippets.

View daemondev's full-sized avatar

Richar Muñico Samaniego daemondev

View GitHub Profile
@daemondev
daemondev / baseURL.groovy
Created June 15, 2023 19:55 — forked from fishi0x01/baseURL.groovy
This is a collection of groovy scripts I gathered and use for bootstrapping Jenkins. Most of this can also be achieved with the CasC Plugin https://github.com/jenkinsci/configuration-as-code-plugin
#!groovy
/*
* This script configures the Jenkins base URL.
*/
import jenkins.model.JenkinsLocationConfiguration
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
location.url = 'https://jenkins-as-code-poc.devtail.io/'
@daemondev
daemondev / squid-whitelist.acl
Created September 19, 2022 14:56 — forked from tjgruber/squid-whitelist.acl
A squid proxy whitelist to get started. Allows all Office 365 and windows updates through proxy.
# PUT IN ALPHABETICAL ORDER
.aadrm.com
.activedirectory.windowsazure.com
.adhybridhealth.azure.com
.ajax.aspnetcdn.com
.ajax.googleapis.com
# .amazon.com
# .amazonaws.com
.appex.bing.com
.appex-rf.msn.com
@daemondev
daemondev / ssl_redirect.py
Created October 3, 2021 02:40 — forked from devries/ssl_redirect.py
WSGI middleware to redirect incoming http requests to https. This is not original, but I can't remember where I first found it.
from urllib import quote
class SSLRedirect(object):
def __init__(self,app):
self.app=app
def __call__(self,environ,start_response):
proto = environ.get('HTTP_X_FORWARDED_PROTO') or environ.get('wsgi.url_scheme', 'http')
if proto=='https':
@daemondev
daemondev / .tmux.conf
Created September 7, 2021 05:30 — forked from gblmarquez/.tmux.conf
.tmux.conf with fish as default shell
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# support logging out and back in
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
# pbcopy support
set-option -g default-command "reattach-to-user-namespace -l bash"
# vi mode
@daemondev
daemondev / infinite.py
Created June 3, 2019 05:49 — forked from categulario/infinite.py
bucle for infinito en python
def inf(i=0, step=1):
#un generador de iteradores infinitos, como el xrange, pero infinito
while True:
yield i
i+=step
for i in inf():
print i
@daemondev
daemondev / multiple_ssh_setting.md
Created December 16, 2018 20:42 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@daemondev
daemondev / docker-machine-no-tls.sh
Last active December 2, 2018 01:39 — forked from armand1m/docker-machine-no-tls.sh
Create docker-machine without TLS verification
docker-machine create -d virtualbox --engine-opt tlsverify=false node1
eval $(docker-machine env node1)
unset DOCKER_TLS_VERIFY
https://hub.docker.com/_/python/
https://docs.docker.com/machine/reference/create/#specifying-docker-swarm-options-for-the-created-machine
@daemondev
daemondev / cache_handler.py
Created November 9, 2018 14:37 — forked from rafaelcapucho/cache_handler.py
Speeding up your MongoDB queries with Tornado Mixin
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from hashlib import md5
import datetime
import tornado.web
@daemondev
daemondev / install-odoo.sh
Created October 30, 2018 20:24 — forked from yelizariev/install-odoo.sh
install odoo from source. Script is maintained on github now: https://github.com/yelizariev/install-odoo
if [ "$(basename $0)" = "install-odoo.sh" ]; then
echo "don't run install-odoo.sh, because it's not fully automated script. Copy, paste and execute commands from this file manually"
exit 0
fi
#### Detect type of system manager
export SYSTEM=''
pidof systemd && export SYSTEM='systemd'
@daemondev
daemondev / main.py
Created September 21, 2018 05:04 — forked from tchen/main.py
Tornado JSON request body
# An example tornado request handler that handles both JSON POST request
# bodies and x-www-form-urlencoded POST bodies.
#
# The benefit of JSON request bodies are more complicated and potentially
# nested dict and list data types.
#
# One drawback to JSON request bodies is that arguments can come in
# different types, so handlers will need to perform additional checks.
# With x-www-form-urlencoded fields, all argument values are strings, if
# they exist.