Skip to content

Instantly share code, notes, and snippets.

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

alankis

🏠
Working from home
  • Mercedes pay Gmbh
  • Berlin, Germany
View GitHub Profile
@alankis
alankis / create-cloud-template.sh
Created January 17, 2021 15:06 — forked from Oratorian/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
Tue Jul 9 04:15:00 2019 -04:00
LENGTH : '154'
ACTION :[7] 'CONNECT'
DATABASE USER:[1] '/'
PRIVILEGE :[6] 'SYSDBA'
CLIENT USER:[5] 'rdsdb'
CLIENT TERMINAL:[0] ''
STATUS:[1] '0'
DBID:[10] '2635182666'
Outputs:
Logical ID:
Description: Information about the value
Value: !Ref MyOwnParameter
Export:
Name: Value to export
#!/bin/bash
path_to_folder=$1
[[ -z `find "$path_to_folder" -mmin -1` ]]
if [ $? -eq 0 ]
then
echo -e "nothing has changed"
else
mail -s "Files in $path_to_folder has been changed" alan.kish38@gmail.com <<< "Files in $path_to_folder has been changed."
#echo -e "files has been changed"
@alankis
alankis / cpanel_find_all_emails_one_liner
Created January 24, 2017 15:22
Export list of all e-mail accounts under desired cPanel username and domain
ls /home/cpanel_username/mail/domain > list_email_accounts | sed -i 's/\///g' lis_email_accounts
@alankis
alankis / lets_encrypt_ssl_config.conf
Created December 6, 2016 10:30
Passenger&Nginx LetsEncrypt virtual host example
# This is neat and simple example of virtual host configuration
# Rails application with LetsEncryptSSL running on nginx and
# Passenger.
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$server_name$request_uri;
}
@alankis
alankis / ruby_ip.rb
Created October 26, 2016 07:17
Ruby as CGI script
a
@alankis
alankis / Perfect remote Rails WorkStation inside your VM.txt
Last active October 27, 2016 14:34
Perfect remote Rails WorkStation inside your VM
1. Get your favorite Linux distro, I am doing this on Lubuntu 16.04, becasue I am short on resources
2. Install it
3. Be sure that networking is in bridge mode
4. Call some terminals with Alt-Ctrl-T
5. Add some password to root user
~ sudo passwd root
6. Install Vi(m) if you don't want to break your fingers
~ apt-get install vim
7. Find out name of netwrok interface that you are using
@alankis
alankis / gist:b2620a0af2728421bec88454e7517f16
Last active September 23, 2016 19:29
Perfect RubyOnRails Developer Environment to Run
This guide is assuming that you are actually running Windows Machine, which is bad, and can ocassionaly occur at your working place :)
This is written and tested on Ubuntu Server 16.04 LTS running as guest OS on Windows host inside VirtulBox. Network adapter is set up to a bridge network. If you changed your network adapter, don't forget to restart guest OS. Ususally sudo init 0 make this magic happen.
1. Add a password for root user
~ sudo passwd root
Enter password twice when prompter
2. Find out your local network IP address
~ ifconfig -a
// Everything different than lo device is actually your network device. Lo is local loopback device. Watch out for inet addr. That is your local IP address.
3. Change IP from dynamic to static
~ vi /etc/network/interfaces
@alankis
alankis / full
Created August 17, 2016 22:03
My FreePBX asterisk log
[root@localhost asterisk]# tail -f full
[2016-08-18 00:01:37] VERBOSE[2634][C-0000000f] netsock2.c: Using SIP RTP TOS bits 184
[2016-08-18 00:01:37] VERBOSE[2634][C-0000000f] netsock2.c: Using SIP RTP CoS mark 5
[2016-08-18 00:01:37] VERBOSE[13972][C-0000000f] pbx.c: Executing [0921929444@from-internal:1] Macro("SIP/300-00000014", "user-callerid,LIMIT,EXTERNAL,") in new stack
[2016-08-18 00:01:37] VERBOSE[13972][C-0000000f] pbx.c: Executing [s@macro-user-callerid:1] Set("SIP/300-00000014", "TOUCH_MONITOR=1471471297.20") in new stack
[2016-08-18 00:01:37] VERBOSE[13972][C-0000000f] pbx.c: Executing [s@macro-user-callerid:2] Set("SIP/300-00000014", "AMPUSER=300") in new stack
[2016-08-18 00:01:37] VERBOSE[13972][C-0000000f] pbx.c: Executing [s@macro-user-callerid:3] GotoIf("SIP/300-00000014", "0?report") in new stack
[2016-08-18 00:01:37] VERBOSE[13972][C-0000000f] pbx.c: Executing [s@macro-user-callerid:4] ExecIf("SIP/300-00000014", "1?Set(REALCALLERIDNUM=300)") in new stack
[2016-08-18 00:01:37] VERBOSE[13972