Find all the files with extension recursively
find . -name \*.txt -print
Reconfigure networking for the lxc containers to assign IP address.
sudo dpkg-reconfigure -p medium lxd
####If you are using AWS ELB and nginx as an web server, | |
####to enable the access logs with details add the following diriectives to your nginx configuration | |
real_ip_header X-Forwarded-For; | |
set_real_ip_from 10.70.0.0/16; |
Find all the files with extension recursively
find . -name \*.txt -print
Reconfigure networking for the lxc containers to assign IP address.
sudo dpkg-reconfigure -p medium lxd
kubectl exec -p <pod-name> -i -t -- bash -il
#!/bin/bash | |
rvm reset | |
rvm uninstall 2.2.7 | |
rvm implode --force | |
sed -i '/rvm/d' ~/.bash_profile | |
sed -i '/rvm/d' ~/.profile | |
sed -i '/rvm/d' ~/.bashrc | |
sudo mv /usr/local/rvm /tmp/ |
cd ~/ | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile | |
source ~/.bash_profile | |
echo "gem: --no-document" > ~/.gemrc | |
gem install bundler |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: nginx | |
template: |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mysql | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: mysql |
This is a snippet that will create a new user in jenkins and if security has been disabled , it will enable it :)
import jenkins.model.*
import hudson.security.*
def instance = Jenkins.getInstance()
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount("MyUSERNAME","MyPASSWORD")
instance.setSecurityRealm(hudsonRealm)