Instantly share code, notes, and snippets.

dasgoll

  • Irbid, Jordan
View GitHub Profile
View gist:8c1742b21e21a7f9a0f1514a245dd4b7
### On Windows, install Ubuntu from Window Store
sudo apt install ccd2iso
ccd2iso FooBar.img FooBar.iso
View gist:c94a20fc55ff8f75d3d10cd65350d905
rvm install ruby-2.3.0
rvm use 2.3.0
rvm gemset create cfgen
rvm gemset list
rvm use 2.3.0@cfgen
gem list
gem install bundler
cd cf-generator
bundle install --path vendor/bundle
@dasgoll
dasgoll / ansible_local_playbooks.md
Created Feb 9, 2019 — forked from alces/ansible_local_playbooks.md
How to run an Ansible playbook locally
View ansible_local_playbooks.md
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
View gist:e643290575006f6602a7a2ba474b61f9
execute something/service in the background
and based on its exist status, execute something else
example
i have installed MySQL NDB cluster. It needs around 2-3 minutes to synchronise the database in between cluster nodes. Once the synchronisation finished only, I can start another application called heartbeat. Therefore in my shell script, I want to check the availability of the ndbd service all the times. Once this service become available, I need to start the heartbeat application
# send to background
./ndb_startup_script &
@dasgoll
dasgoll / gist:8a360818dfe78fc286d773ee5cfdd654
Last active Feb 8, 2019
access ssh hidden service via tor
View gist:8a360818dfe78fc286d773ee5cfdd654
### on server
apt-get update
apt-get install vim tor -y
vim /etc/tor/torrc
HiddenServiceDir /var/lib/tor/ssh_hidden_service/
HiddenServicePort 22 127.0.0.1:22
systemctl restart tor
### on client
@dasgoll
dasgoll / gist:561c78b44e2134b0a5268d6e84b60e70
Created Feb 2, 2019
ChromeCast setup reset change wifi network wireless
View gist:561c78b44e2134b0a5268d6e84b60e70
ChromeCast is connected to Umniah's WiFi 'Goll'
guest mode is not enabled.
This WiFi got disconnected, no longer there.
1/ from iphone - create hotspot
2/ from android phone connect to the Chromecast's WiFi
run Google Home app - setup
connect it to iphone's WiFi
View gist:2f27ec2b703fbcb49a273d550d7865f8
https://medium.freecodecamp.org/send-emails-using-code-4fcea9df63f
# import the smtplib module. It should be included in Python by default
import smtplib
# set up the SMTP server
s = smtplib.SMTP(host='smtp-mail.outlook.com', port=587)
s.starttls()
s.login('jameel@outlook.com', 'password')
===
import smtplib
View gist:9015e442054d03ff5764f7cea3a45098
### git tag tutorial - you wanna pump version to 1.0.3
### tag is a pointer to a commitID
### on your laptop
git clone /mnt2/project1.git
cd project1
# you will in branch master by default
git tag ## see last tag
1.0.0
1.0.1
View gist:680582c44eede18693e67aedfbc546e8
### git server on Linux
useradd goll
mkdir /mnt2/
cd /mnt2
git init --bare project1.git
chmod 777 -R /mnt2
GIT_SSH_COMMAND='ssh -F /dev/null' git clone goll@54.10.11.52:/mnt2/project1.git
or better
@dasgoll
dasgoll / gist:712ce935287f802af9d2acb04a801ede
Last active Jan 28, 2019
Install sshpass on macOS - user login with password while server is PasswordAuthentication no
View gist:712ce935287f802af9d2acb04a801ede
### no password login is allowed
PasswordAuthentication no
### but we allow it for user jameel
Match User jameel
PasswordAuthentication yes
Match all