Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #xampp
- #https://premium.wpmudev.org/blog/setting-up-xampp/
- mv /opt/lampp/htdocs/wordpress/wp-config-sample.php /opt/lampp/htdocs/wordpress/wp-config.php
- Replace“database_name_here” with the name of your database, which in my case is “WP”
- Replace “username_here” with “root” and leave “password_here” blank
- #ftp
- #http://www.kometschuh.de/XAMPPFTPConfigurtionMacOSX.html
- username: daemon
- pw: xampp
- #to work with ftp
- chown -R daemon /opt/lampp/htdocs
- #restore from backup
- #https://wpremote.com/support-center/getting-started-with-wp-remote/restore-from-backup/
- siteurl and home values in your wp_options
- #wordpress
- cd ~
- wget https://wordpress.org/latest.tar.gz
- wget https://downloadsapachefriends.global.ssl.fastly.net/xampp-files/5.6.30/xampp-linux-x64-5.6.30-0-installer.run
- chmod +x xampp-linux-x64-5.6.30-0-installer.run
- ./xampp-linux-x64-5.6.30-0-installer.run
- docker -i -t -p 80:80 centos:centos7 /bin/bash
- docker run -i -t -p 80:80 centos:centos7 /bin/bash
- docker ps -a
- docker rename d29163cda4b5 xampp
- docker start xampp
- docker ps -a
- #wordpress "object not found
- #http://www.wpbeginner.com/wp-tutorials/how-to-restore-a-wordpress-site-with-just-database-backup/
- #images are lost
- #http://www.inmotionhosting.com/support/edu/wordpress/migrating-wordpress-inmotion-hosting/correct-image-links
- wp-posts
- Go to your dashboard, to settings, and to Permalinks. Restore the permalinks structure to its original state and update. After doing this you should be able to restore it any other state that you like without experiencing problems.
- UPDATE wp_posts SET post_content=(REPLACE (post_content, '<old url>','<new url>'));
- nano /etc/hosts
- 172.0.0.1 thistleknot.ddns.net
- #sshd
- yum remove openssh-server openssh-client -y
- yum install openssh-server openssh-client -y
- ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
- ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
- xauth
- /usr/sbin/sshd
- # firefox & error: D-Bus not built with -rdynamic so unable to print a backtrace
- #http://www.torkwrench.com/2011/12/16/d-bus-library-appears-to-be-incorrectly-set-up-failed-to-read-machine-uuid-failed-to-open-varlibdbusmachine-id/
- dbus-uuidgen > /var/lib/dbus/machine-id
- #docker network
- #docker network create --subnet=192.168.3.0/24 3-24
- #docker run --net 3-24 --expose=8080 --ip 192.168.3.50 -it bd6de9998194 bash
- #ip route add 192.168.3.0/24 via 192.168.3.1 dev eth0
- #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 --bip=192.168.3.1/26"
- docker run -i -t -p 8080:8080 bd6de9998194 /bin/bash
- docker exec 63b1f52c5ecb /opt/tomcat/bin/startup.sh
- #on host
- <hostIP>:8080
- #add route
- route add 172.17.0.0 MASK 255.0.0.0 172.17.0.1
- #reverse ssh will not open up ports
- could add a route? I was able to route to 172.
- #to install
- #general docker info http://www.tecmint.com/install-docker-and-learn-containers-in-centos-rhel-7-6/
- yum install docker
- systemctl start docker
- systemctl status docker
- systemctl enable docker
- #setup port forwarding in vBox
- 2022 to 22
- #to get up and running
- docker pull centos:centos7
- #-i interactive -t run until I tell it to stop
- #docker run -i -t -p 8080:8080 centos:centos7 yum install -y firefox net-tools ip-route openssh-server openssh-clients xorg-x11-xinit wget java nano NetworkManager NetworkManager-tui unzip
- docker run -it -d --net=bridge bd6de9998194 /bin/bash
- docker start <containerName>
- docker attach <container> (after starting)
- passwd
- exit
- #still running? if not restart
- docker ps -a
- #docker start <containerId>
- docker commit <containerId>
- #rename container
- #list containers (check for most recent)
- docker ps -a
- docker rename <containerId> newContainerName
- #rename image
- #list images
- docker images
- docker tag <imageId> 127.0.0.1:<newName>
- #ssh
- docker exec C7v2 /usr/sbin/sshd
- docker exec C7v2 ifconfig
- docker exec C7v2 /usr/sbin/xauth exit
- ssh -X [email protected] -p 2022
- #Or ssh -X <ip>
- #tomcat
- #https://www.vultr.com/docs/how-to-install-apache-tomcat-8-on-centos-7
- wget http://apache.osuosl.org/tomcat/tomcat-8/v8.5.11/bin/apache-tomcat-8.5.11.tar.gz
- docker start <container>
- #confirm running, might require
- #exit
- docker ps -a
- #send commands
- docker exec <container> <command>
- #bridged network adapter so virtualBox docker image can see router directly. Can use two adapters. one is 172.x (NAT), the other is 192.x
- #get container id/name
- docker ps -l
- docker ps -a
- docker start <container id/name>
- #inside container
- ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
- docker commit <name>
- docker ps -a
- docker rename <container id> <new_name>
- docker images (see your new image)
- docker tag <imageID> 127.0.0.1:CentOSwSSH
- docker rename <container id> <new_name>
- docker start <name>
- #has changes
- docker attach <name>
- docker exec <name> ifconfig
- #sshd to work
- passwd <set root passwd to W3canH3LP!>
- /usr/sbin/sshd-keygen -A
- #outside of container <commit>
- docker exec <name> /usr/sbin/sshd
- #get ip
- docker exec <name> ifconfig
- #run with systemD?, required for sshd to start
- #docker run --privileged -ti -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup trinitronx/ansible-base:stable-centos7 /usr/sbin/init
- #vs ssh
- docker exec -ti containername sh
- #x11 forwarding info
- #on host
- yum install -y firefox auth
- xauth exit
- ssh -X <hostIP>
- ssh -X <dockerIP>
- #http://stackoverflow.com/questions/25281992/alternatives-to-ssh-x11-forwarding-for-docker-containers
- docker run -i -t --rm \
- -e DISPLAY=$DISPLAY \
- #missing -u docker
- docker run -i -t --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix/:ro --name="x11" centos:centos7
- #http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/
- #https://linuxmeerkat.wordpress.com/2014/10/17/running-a-gui-application-in-a-docker-container/
- #remove all dockers
- #https://tecadmin.net/remove-docker-images-and-containers/#
- #stop & remove all docker containers
- docker stop $(docker ps -a -q)
- docker rm $(docker ps -a -q)
- # run as service
- docker run -d centos:centos7 /bin/yes
- #remove all images-and-containers/#
- docker rmi $(docker images -a -q)
- #export/import
- #https://www.jamescoyle.net/how-to/1512-export-and-import-a-docker-image-between-nodes
- docker commit 3a09b2588478 mynewimage
- docker save mynewimage > /tmp/mynewimage.tar
- docker load < /tmp/mynewimage.tar
- #running systemD
- https://developers.redhat.com/blog/2014/05/05/running-systemd-within-docker-container/
- #build Dockerfile
- mkdir test
- cd test
- nano Dockerfile
- FROM centos:centos7
- ENV container docker
- RUN yum -y update; yum clean all
- RUN yum -y install systemd net-tools ip-route firefox xauth; yum clean all;
- RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || f $i; done);
- RUN rm -f /lib/systemd/system/multi-user.target.wants/*;
- RUN rm -f /etc/systemd/system/*.wants/*;
- RUN rm -f /lib/systemd/system/local-fs.target.wants/*;
- RUN rm -f /lib/systemd/system/sockets.target.wants/*udev*;
- RUN rm -f /lib/systemd/system/sockets.target.wants/*initctl*;
- RUN rm -f /lib/systemd/system/basic.target.wants/*;
- RUN rm -f /lib/systemd/system/anaconda.target.wants/*;
- RUN /usr/bin/xauth exit
- VOLUME [ “/sys/fs/cgroup” ]
- CMD /usr/sbin/init
- #uses current directory /Dockerfile
- #build own image
- #https://docs.docker.com/engine/getstarted/step_four/
- docker build -t centos:centos7 .
- #tomcat up on outside ip
- #http://stackoverflow.com/questions/6246127/cant-access-tomcat-using-ip-address
- /conf/server.xml
- <Connector port="8080" protocol="HTTP/1.1"
- connectionTimeout="20000"
- redirectPort="8443"
- useIPVHosts="true"
- address="172.17.0.2" />
- #expose port
- docker --expose=8080
- docker run <imagename> -p 8080:8080
- #port forwarding
- docker run -p 8080:3000 my-image
Advertisement
Add Comment
Please, Sign In to add comment