Skip to content

Instantly share code, notes, and snippets.

@zetekla
Last active June 3, 2018 05:32
Show Gist options
  • Save zetekla/b59103e6e85519fa9cca677e341d93c7 to your computer and use it in GitHub Desktop.
Save zetekla/b59103e6e85519fa9cca677e341d93c7 to your computer and use it in GitHub Desktop.
Linux-cfg
new vpn startup:
- enter `su -` for root.
- adduser hiveXYZ, change their password: `passwd admin` and set wheel for `sudo` access, enter: `usermod -aG wheel hiveXYZ`
with sudo, a user can view root content by doing: `sudo ls -la /root`
- add wheel group if CentOS server doesn't have it enabled: `vi /etc/pam.d/su`and edit for:
# Uncomment the following line to require a user to be in the `wheel` group.
auth required pam_wheel.so use_uid
- disable root `vi /etc/ssh/sshd_config` and do `PermitRootLogin no`
- change port `vi /etc/ssh/sshd_config` and do `service sshd restart`
- fix selinux issue after changing port https://serverfault.com/questions/834195/ssh-fails-after-port-change-on-centos-7-with-plesk
semanage port -a -t ssh_port_t -p tcp 977 (replace 977 with your port number)
refs: https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-centos-quickstart
https://www.liberiangeek.net/2014/11/change-openssh-port-centos-7/
in cli,
mind the dhcp problem (src:https://stackoverflow.com/questions/32524675/centos-7-1-error-repository),
`dhclient`
https://www.ctrl.blog/entry/how-to-win10-ssh-service
`ssh user@ipaddress`
https://www.centos.org/forums/viewtopic.php?t=60003
https://docs.docker.com/install/linux/docker-ce/centos/#install-from-a-package
(the Docker official tutorial is a stable one for installing it on CentOS7,
cli: ` sudo yum install -y docker-ce-17.06.1.ce`)
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-centos-7
Installing postgre
`sudo docker run --name pg -d -e POSTGRES_USER=***db -e POSTGRES_PASSWORD=***2018 posgres`
`sudo docker exec -it pg bash`
`psql -U hivelogicdb -h 172.17.0.2 -p 5432`
Open Project:
simplest installation w/ Postgre: `docker run -it -p 8080:80 -e SECRET_KEY_BASE=secret openproject/community:7`
run without logs
`docker run -d -p 8080:80 -e SECRET_KEY_BASE=secret openproject/community:7`
clone docker container into image, restore from image, backup data... Ref: https://gist.github.com/thaJeztah/8d0e901bd21329d80cf2
To go into a docker container and start viewing its content, do this: docker exec -it <mycontainer> bash
install vim-tiny (src: https://stackoverflow.com/a/30859601/5828821)
`apt-get update`
`apt-get install vim-tiny`
// Jenkins & Tomcat
https://www.tutorialspoint.com/jenkins/jenkins_git_setup.htm
1.download Jenkins war file
2. Copy that war file into webapps folder
3. Run tomcat, accessing to jenkins at port 8080 http://localhost:8080/jenkins
Linux Homebrew for CentOS
https://gist.github.com/stephenturner/e3bc5cfacc2dc67eca8b
xinput --list --short
xinput --list-props "VMware VMware Virtual USB Mouse"
xinput --set-prop "VMware VMware Virtual USB Mouse" "Device Accel Constant Deceleration" 0.7
--CHROME--
yum install gtk3-devel -y
yum install google-chrome-stable -y
--YUMEX--
https://centos.pkgs.org/7/epel-x86_64/yumex-3.0.17-1.el7.noarch.rpm.html
To install VMTool for Debian 9
Executive summary:
su -
apt-get install open-vm-tools-desktop
reboot
To change cursor size:
dconf write /org/gnome/desktop/interface/cursor-size 48
su -
reboot
That's it for Gnome. For Debian Xcfe, Just go to settings manager, mouse and select your theme to change cursor-size with the GUI.
---
switching desktop env Debian: https://debian-handbook.info/browse/stable/sect.graphical-desktops.html
ls /usr/share/xsessions
https://superuser.com/questions/685970/how-to-set-a-default-desktop-environment-at-system-start
---
You can fix this by installing missing dependencies.
Just run the following command
(after you have run sudo dpkg -i google-chrome-stable_current_i386.deb).
sudo apt-get install -f
This will install missing dependencies and configure Google Chrome for you.
/usr/share/applications/
To create a shortcut launcher for the installed application, make sure it has an associated *.desktop file, usually residing in /usr/share/applications/. You should then be able to right-click your desktop and select something like "create launcher", providing the path to the application if it's not in the list.
https://superuser.com/a/378058
version: '3.1'
services:
joomla:
image: joomla
restart: always
links:
- joomladb:mysql
ports:
- 7071:80
environment:
JOOMLA_DB_HOST: joomladb
JOOMLA_DB_PASSWORD: pwd
joomladb:
image: mysql:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: pwd
http://blog.cloud66.com/how-to-get-code-into-a-docker-container/
https://en.wikipedia.org/wiki/Breadth-first_search
https://lifehacker.com/turn-an-old-mac-into-a-cheap-vpn-with-os-x-server-1743411938
Citrix:
https://discussions.citrix.com/topic/278284-how-to-set-up-a-basic-citrix-server-network/
https://blog.norz.at/what-do-we-need-to-create-a-citrix-environment-at-home/
CATEGORIZE websites:
https://secure2.sophos.com/en-us/support/contact-support.aspx
https://community.sophos.com/kb?TopicId=10287
https://www.quora.com/How-do-I-categorize-a-website-domain
https://community.sophos.com/kb/en-us/118925
https://www.namecheap.com/support/knowledgebase/article.aspx/9677/46/how-to-categorize-my-domains
https://www.quora.com/Which-websites-categorize-startups-by-type
https://serverfault.com/questions/251411/how-to-change-the-url-category-of-a-website-so-its-not-filtered
https://cd-rw.org/t/de-uglyfying-majaro-linux-xfce/352/5
https://forum.manjaro.org/t/plank-cannot-change-settings/10051/3
https://forum.manjaro.org/t/how-to-autologin-for-manjaro-linux-xfce-on-start-up/9752
wallpaper
https://taylantatli.deviantart.com/art/Manjaro-Ascella-XFCE-418834669
So even though you can install the current stable Ruby 2.3.3 by just doing pacman -S ruby or pacaur -S ruby you will eventually need to switch back to Ruby 2.1 or older for a client project, for example.
Should you install RVM? Or rbenv? And how do you deal with different versions of Clojure, Go, Rust, Elixir?
That sounds like yet another maintenance nightmare to deal with. But someone decided to actually solve this problem in an elegant way. Enter asdf - and if you happen to know Akash Manohar give him a big hug.
http://www.akitaonrails.com/2017/01/10/arch-linux-best-distro-ever
Teamviewer 12 not starting on Manjaro & Antegos, downgrade freetype to get it work, execute the line below:
sudo pacman -U https://archive.archlinux.org/packages/l/lib32-freetype2/lib32-freetype2-2.8-2-x86_64.pkg.tar.xz
---
installing Chrome: `yaourt -S google-chrome`
---
TO TURN OFF beep sound - Manjaro
Then open your .xprofile file
sudo mousepad ~/.xprofile
add this line to your .xprofile
xset -b
#src: https://forum.manjaro.org/t/how-disable-bios-beep-like-sound-in-some-applications/17094/5
---
To install NodeJS & Npm on Manjaro, the best way to do is to install them through NVM:
https://stackoverflow.com/a/37186410/5828821
`curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash`
`curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash`
then
install the nodejs: `nvm install node`
---
Share Virtual Machines directory VmWare (Manjaro)
/var/lib/vmware/SharedVMs/
--- For VMWare to work properly on Manjaro, install VMWare 14 appImage and unlocker2.1.1 (latest atm), update siiriDrive to have it.
https://forum.manjaro.org/t/wiki-installing-vmware/19824
USB2.0 setting for usb will help MacOS gets the Bluetooth on.
Need to unmount the Bluetooth USB dongle to get it work inside the MacOS.
EXECUTIVE SUMMARY:
lsusb
results:
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 012: ID 05ac:0220 Apple, Inc. Aluminum Keyboard (ANSI)
Bus 003 Device 011: ID 05ac:1006 Apple, Inc. Hub in Aluminum Keyboard
Bus 003 Device 004: ID 0bda:0182 Realtek Semiconductor Corp.
Bus 003 Device 015: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 003 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 003 Device 010: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 003 Device 014: ID 0a5c:21ec Broadcom Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udisks2 --detach /dev/bus/usb/003/015
umount /dev/bus/usb/003/015
udisks --detach /dev/bus/usb/003/015
sudo eject /dev/bus/usb/003/015
---
umount /dev/sdg1
sudo eject /dev/sdg
ls /sys/bus/usb/devices/
lsusb
udiskie : tool for removable disk automounter using udisks.
udisks2 : tool for disk management service, v2
eject will work, but will not really "finish the job" regarding USB rotating drives.
The best way to unplug a USB external hard-drive, after proper unmounting, is:
udisks --detach /dev/sdb
https://unix.stackexchange.com/a/129282/29483
EDIT: Also, as g.rocket points out, this command may be equivalent:
udisksctl power-off -b /dev/sdb
# src:
https://unix.stackexchange.com/a/129282/184673
https://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line
https://askubuntu.com/questions/727290/how-do-i-soft-remove-a-usb-port
https://github.com/Lefinnois/USBdetach
http://www.akitaonrails.com/2017/01/10/arch-linux-best-distro-ever
---
SOLVED: moved the command back one level...
root@blackserver:/sys/devices/pci0000:00/0000:00:1a.0# echo -n 1 > remove
dmesg output now...
[65207.355668] ehci-pci 0000:00:1a.0: remove, state 4
[65207.355680] usb usb3: USB disconnect, device number 1
[65207.355682] usb 3-1: USB disconnect, device number 2
[65207.360110] ehci-pci 0000:00:1a.0: USB bus 3 deregistered
[65207.475341] iommu: Removing device 0000:00:1a.0 from group 7
No other error messages and the USB controller is no longer listed in lspci or devices shown in lsusb.
# src:
https://askubuntu.com/questions/727290/how-do-i-soft-remove-a-usb-port
Manjaro Hardware Detection Overview
https://wiki.manjaro.org/index.php?title=Manjaro_Hardware_Detection_Overview
DISTINGUISH .bashrc, .bash_profile, .xprofile,...
https://www.reddit.com/r/linux/comments/1p6orz/bashrc_bash_profile_inputrc_profile_xprofile/
FIND BEST MIRROR location for pacman download
sudo pacman-mirrors -g
@zetekla
Copy link
Author

zetekla commented Oct 18, 2017

@zetekla
Copy link
Author

zetekla commented Oct 19, 2017

@zetekla
Copy link
Author

zetekla commented Oct 19, 2017

SOLUTION 1 to "The specified device appears to be claimed by another driver" https://ubuntuforums.org/showthread.php?t=1389308

possible, flexible solution 2: From ubuntu 16.04 onwards systemd manages startup services like bluetooth ... to view current status issue

following in a terminal
sudo systemctl status bluetooth.service

to deactivate bluetooth on startup issue this
sudo systemctl disable bluetooth.service

then on next reboot bluetooth will not be active ... to enable bluetooth issue
sudo systemctl enable bluetooth.service

@zetekla
Copy link
Author

zetekla commented Oct 21, 2017

LIST HARDWARE

inxi -F

lspci -k

@zetekla
Copy link
Author

zetekla commented Feb 21, 2018

#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

@zetekla
Copy link
Author

zetekla commented Mar 5, 2018

secure and monitor web-server
https://www.imunify360.com/

@zetekla
Copy link
Author

zetekla commented Jun 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment