This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
q=window.getSelection().toString().replace(/[^0-9]/g,%20''); | |
if (!q) { | |
q=prompt('Enter%20Bugid:') | |
} | |
if (q) { | |
window.open('https://bugs.XYZCompany.com/show_bug.cgi?id='+escape(q)) | |
} else { | |
window.open('http://bugs.XYZCompany.com') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install youtube download from https://rg3.github.io/youtube-dl/download.html | |
Install ffmpeg on your system | |
youtube-dl --extract-audio --audio-format mp3 -f bestaudio <youtube-url> | |
sometimes file names are too long.. use | |
youtube-dl --extract-audio --audio-format mp3 -f bestaudio 'https://www.youtube.com/watch?v=owJojkB3MHk' -o "sivaji_sad_songs2.%(ext)s" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start the containers | |
docker run --name web1 -d -t ubuntu | |
docker run --name web2 -d -t ubuntu | |
docker run --name db1 -d -t ubuntu | |
# print the ip addresses of the containers | |
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' we b1 | |
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' we b2 | |
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################## Dockerfile ################### | |
FROM ubuntu:16.04 | |
RUN apt-get update && apt-get install -y openssh-server | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:screencast' | chpasswd | |
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
# SSH login fix. Otherwise user is kicked off after login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# available at gist: | |
# https://gist.github.com/xbalaji/ecd428eb8ee48981cb24ac0c57c8d21b | |
# | |
################## Dockerfile ################### | |
# from | |
# https://docs.docker.com/engine/examples/running_ssh_service/ | |
# | |
# build command | |
# docker build -f <Dockerfile> -t ubsshpy . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls -dl /mnt/hgfs/host-c | |
cd / | |
hostname -I | |
python3 -m http.server --bind $(hostname -I) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
vars: | |
tmp_dir: "/tmp/ansible-test" | |
tasks: | |
- name: create directories | |
file: | |
path: "{{tmp_dir}}/{{item}}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
mystr="this is a complex string !@#$%^&*()-=+,.?:;'\\/\" with numbers 1234?" | |
# note: raw string used with double quotes in re.sub | |
out_str = re.sub(r"([ !@#$%^&*()\-=+,.?:;'/\\\"])", r'_', mystr) | |
print(mystr) | |
print(out_str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://askubuntu.com/questions/53822/how-do-you-run-ubuntu-server-with-a-gui | |
sudo apt -y update | |
sudo apt install -y xorg | |
sudo apt install -y --no-install-recommends lightdm-gtk-greeter | |
sudo apt install -y --no-install-recommends lightdm | |
sudo apt install -y --no-install-recommends ubuntu-gnome-desktop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get facts from a remote 'myhost.com' with ssh user root, password on prompt | |
ansible all -i 'myhost.com,' -m setup -u root -k | |
# Ansible playbook structure - create directories first, so you can run a single touch command | |
mkdir -p group_vars host_vars library filter_plugin roles/common/{tasks,handlers,templates,files,vars,defaults,meta} | |
touch ansible.cfg hosts.ini site.yml staging.ini production.ini roles/common/{tasks,handlers,templates,files,vars,defaults,meta}/main.yml |
OlderNewer