Skip to content

Instantly share code, notes, and snippets.

@Radamanf
Radamanf / sfdx-jenkinsfile
Last active August 2, 2019 11:35
Jenkins file to deploy to Salesforce with SFDX into Sandboxes instead of using DevHub org, to use it you will require two global variables USERNAME and PASSKEY setup in Jenkins, also you have to add "Source Code Management" -> Git details into your Jenkins freestyle project
#!/bin/bash
#Exit from build:
#params: 1 - status, 2 - callback command to call before exit, 3 - comment text for failed GitHub commit
exit_on_error() {
if [ $1 -ne 0 ]
then
echo '=== ### Exit On Error ### ==='
if [ "$2" != '' ]
then
$2
@Radamanf
Radamanf / _etc_systemd_system_kafka.service
Last active February 20, 2023 06:13
Kafka daemon with System.d. You also can use bin/kafka for init.d. Just unzip ZooKeeper and Kafka to you home/user/soft/ dir and create listed three files then enable them to be autostarted by systemctl enable kafka.service and systemctl enable zookeeper.service.
[Unit]
Description=Apache Kafka server (broker)
Documentation=http://kafka.apache.org/documentation.html
Requires=zookeeper.service network.target remote-fs.target
After=zookeeper.service network.target remote-fs.target
[Service]
Type=forking
PIDFile=/var/run/kafka.pid
ExecStart=/home/user/bin/kafka start
@Radamanf
Radamanf / Ghost - Demonize anything
Last active January 6, 2020 16:04
This is an initialization script "/etc/init.d/ghost" file which helps you to start, stop, status executable or java -jar file.jar with nohup and & - background option, this is pretend way make a daemon, but maybe will be interested to someone. It uses PID file and checks if the process is running before every start or stop. Once it's configured …
#!/bin/bash
# Licence: GPLv3, MIT, BSD, Apache or whatever you prefer; FREE to use, modify, copy, no obligations
# Description: Bash Script to Start the process with NOHUP and & - in background, pretend to be a Daemon
# Author: Andrew Bikadorov
# Script v1.5
# For debugging purposes uncomment next line
#set -x