Skip to content

Instantly share code, notes, and snippets.

@sati2013
sati2013 / README-tomcat-as-systemd-service.md
Created August 16, 2021 16:39 — forked from drmalex07/README-tomcat-as-systemd-service.md
An example configuration for Tomcat as systemd service. #tomcat #systemd #systemd.service

README

Let Tomcat is download and installed under /opt/tomcat. Also, let tomcat be a non-provileged user under which the server will be running.

We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories). See also https://dzone.com/articles/running-multiple-tomcat.

Create a template service unit file at /etc/systemd/system/tomcat@.service:

@dcode
dcode / ol7_addons.repo.sh
Last active May 18, 2020 20:01
Enable the OL7 Add-ons repo. Includes virtualbox, docker, R, and others.
cat << EOF | sudo tee /etc/yum.repos.d/ol7_addons.repo
[ol7_addons]
name=Oracle Linux $releasever Add ons (\$basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/addons/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
EOF
# Verify this manually if you're paranoid like me
@premit
premit / imdb_next_page_spider.py
Created July 23, 2014 14:14
Scrapy reference: Crawling next pagination
'''
Spider for IMDb
- Retrieve most popular movies & TV series with rating of 8.0 and above
- Crawl next pages recursively
'''
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
@jquast
jquast / move-zone.sh
Created March 12, 2013 04:25
Solaris 10 zone migration script -- transfers a virtual machine to another physical host by ssh.
#!/bin/ksh
# contact@jeffquast.com
#
# move a zone by replicating a zfs container to a remote host,
# exporting and importing the zone configuration and attaching the container,
# then destroying the previous zone after the destination zone is verified.
#
# default containers are 'tank' or 'rootpool'
#
# references:
@sati2013
sati2013 / gist:4680442
Last active December 11, 2015 23:58 — forked from bortzmeyer/gist:1284249
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
@monsat
monsat / basics.sh
Created March 13, 2012 03:53
Create a user
#!/bin/sh
#
# CentOS6.2
#
#
# vars
#
UNAME=`uname -i`
@sms420
sms420 / gist:377950
Created April 24, 2010 21:14
script ssh login
#!/usr/bin/expect -f
spawn ssh USER@DOMAIN
expect "*?assword:*"
send -- "PASSWORD\r"
send -- "\r"