Skip to content

Instantly share code, notes, and snippets.

View linuxoid69's full-sized avatar
🏠
Working from home

Rustam linuxoid69

🏠
Working from home
View GitHub Profile
@linuxoid69
linuxoid69 / 0_rpm.md
Created September 20, 2017 19:42 — forked from Driste/0_rpm.md
RPM

RPM: Red-Hat Package Manager

The basic procedure to build an RPM is as follows:

  • Get the source code you are building the RPM for to build on your system.
  • Make a patch of any changes you had to make to the sources to get them to build properly.
  • Make a spec file for the package.
  • Make sure everything is in its proper place.
  • Build the package using RPM.

The Spec file

@linuxoid69
linuxoid69 / client
Last active July 17, 2017 14:10
python activemq example
#!/usr/bin/env python
import time
import sys
import stomp
from stomp import *
conn = stomp.Connection()
conn.start()
conn.connect('admin', 'admin', wait=True)
@linuxoid69
linuxoid69 / server socket
Created June 17, 2017 18:25
server socket
#!/usr/bin/env python
import socket
from socket import AF_INET, SOCK_STREAM
HOST = '' # Symbolic name meaning all available interfaces
PORT = 50007 # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT))
s.listen(0)
@linuxoid69
linuxoid69 / ssl
Created April 23, 2017 19:20
ssl self-sign
# create CA key and cert
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -key rootCA.key -days 10000 -out rootCA.crt
# create host key, csr and sing host cert CA
openssl genrsa -out server101.mycloud.key 2048
openssl req -new -key server101.mycloud.key -out server101.mycloud.csr
openssl x509 -req -in server101.mycloud.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out server101.mycloud.crt -days 5000
@linuxoid69
linuxoid69 / activemq.service
Created January 20, 2017 10:55
ActiveMQ service file for systemd
# cat activemq.service
[Unit]
Description=Apache ActiveMQ
After=network-online.target
[Service]
Type=forking
WorkingDirectory=/opt/activemq/bin
ExecStart=/opt/activemq/bin/activemq start
ExecStop=/opt/activemq/bin/activemq stop
@linuxoid69
linuxoid69 / autopgsqlbackup
Created April 22, 2016 13:19 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@linuxoid69
linuxoid69 / i3status.conf
Created February 5, 2016 07:21
i3status.conf
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
@linuxoid69
linuxoid69 / i3config
Created February 5, 2016 07:19
i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@linuxoid69
linuxoid69 / token_ya_disk
Created December 24, 2015 12:24
Получение токена для яндекс диска
# -*- coding: utf-8 -*-
from bottle import route, run, request
import httplib
import urllib
import json
#Идентификатор приложения
client_id = ''
#Пароль приложения
client_secret = ''
@linuxoid69
linuxoid69 / PackageApplication.patch
Created October 28, 2015 07:31
patch /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication 2015-10-06 00:07:37.000000000 +0300
+++ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication.old 2015-10-27 18:10:59.000000000 +0300
@@ -152,9 +152,8 @@
}
}
- my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",
- "--sign", $opt{sign},
- "--resource-rules=$destApp/ResourceRules.plist");
+ my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements",