Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

LXC: create Debian Squeeze container

<?php
$URL="https://raw.githubusercontent.com/panticz/lxc/master/create.squeeze.sh";

echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

(re)create container

wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/create.squeeze.sh -O - | bash -s -- -f

Default login credentials
user: root
pass: root

Fix DNS

echo nameserver 8.8.8.8 > /var/lib/lxc/${CONTAINER}/rootfs/etc/resolv.conf

Git

CLI

# show repository info
git describe
git config -l

# show commit info
git show 

# show diff for one file
git diff 
git --no-pager diff

# commit only one file
git commit -m 'my comment' path/to/file

# create Git repository
git init

# change upstream server
git remote set-url origin git@git.example.com:foo/bar.git

# add all files
git add .

# commit
git commit -m "initial project version"

# revert
git revert 

# cancel merge
git merge --abort

# list tag
git tag -l

# get files changed in commit
git diff-tree --no-commit-id --name-only -r 

# reset marge
git reset --hard origin/master

checkout

Create a restricted user for SSH tunneling

<?php
$URL="https://raw.githubusercontent.com/panticz/scripts/master/create_ssh_tunnel_user.sh";

echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Add your public key(s)

cat /tmp/authorized_keys > /home/tunnel/.ssh/authorized_keys
sed -i 's|ssh-rsa|command="/bin/false",no-pty,no-X11-forwarding ssh-rsa|g' /home/tunnel/.ssh/authorized_keys
# parameter

command="/bin/false",no-agent-forwarding,no-pty,no-user-rc,no-X11-forwarding,permitopen="127.0.0.1:80"
no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding

Links
http://www.gnu.org/software/bash/manual/html_node/The-Restricted-Shell.html

Update LXC container templates filesystem

[embed_url: https://raw.githubusercontent.com/panticz/lxc/master/scripts/lxc-update-templates.sh]

# fix dns
echo "nameserver 8.8.8.8" > /var/cache/lxc/debian/rootfs-wheezy-amd64/etc/resolv.conf

Cronjob

echo "0 13 * * *    root    /usr/bin/wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/scripts/lxc-update-templates.sh -O - | bash -" > /etc/cron.d/lxc_update_template
service cron restart
# fix squeeze repository
sed -i 's|cdn.debian.net|ftp.debian.org|g' /var/cache/lxc/debian/rootfs-squeeze-amd64/etc/apt/sources.list

Install Google Music Manager

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.google-musicmanager.sh";

echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

$ cat /etc/apt/sources.list.d/google-musicmanager.list

deb http://dl.google.com/linux/musicmanager/deb/ stable main

Links
https://play.google.com/music/listen?u=0#/manager

IO performance benchmark script

Install
<?php
$URL="https://raw.githubusercontent.com/panticz/scripts/master/fio.sh";

echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Install Vega vulnerability scanner under Ubuntu / Debian

Install
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.vega.sh";

echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Workarround

sudo mkdir -p /usr/share/vega/workspace/
sudo chmod 777 /usr/share/vega/workspace/

Download
https://subgraph.com/vega/download/

Configuration
diff /usr/share/vega/Vega.ini.2015-01-12 /usr/share/vega/Vega.ini
2,5c2,5
< -Xms256m
< -XX:PermSize=128m
< -XX:MaxPermSize=256m
< -Xmx2048m
---
> -Xms1024m
> -XX:PermSize=512m
> -XX:MaxPermSize=1024m
> -Xmx4096m

Puppet: iPXE boot module

# create module structure

mkdir -p /etc/puppet/modules/ipxe/files
mkdir -p /etc/puppet/modules/ipxe/manifests

# download files

wget -q http://dl.panticz.de/ipxe/ipxe.lkrn -O /etc/puppet/modules/ipxe/files/ipxe.lkrn
wget -q http://dl.panticz.de/ipxe/49_ipxe -O /etc/puppet/modules/ipxe/files/49_ipxe

# download module definiction
<?php
$URL="https://raw.githubusercontent.com/panticz/puppet/master/modules/ipxe/init.pp";

echo "wget -q $URL -O /etc/puppet/modules/ipxe/manifests/init.pp";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Jenkins: install and configure JDK

# download and extract JDK
URL=http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz
wget --continue --no-check-certificate --header "Cookie: oraclelicense=a" ${URL} -O /tmp/${URL##*/}
tar -C /var/lib/jenkins/tools/hudson.model.JDK/ -xzf /tmp/jdk-8u25-linux-x64.tar.gz
# configure JDK

http://192.168.1.111:8080/configure
JDK
JDK installations
Add JDK
Install automatically: check out
JAVA_HOME: /var/lib/jenkins/tools/hudson.model.JDK/jdk1.8.0_25
Save

# create New Item

Item name: JDBCTest
check "Freestyle project"
JDK: JDK8
Build > Execute shell > Command
javac JDBCTest.java && java JDBCTest
Save

Build Now

Upload / Create file on Jenkins machine:

# /var/lib/jenkins/jobs/JDBCTest/workspace/JDBCTest.java

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCTest {
public static void main(String[] args) {
String HOST = "db_host";
String DB = "db_name";
String USER = "user_name";
String PASSWORD = "user_pass";

System.out.println("java.version:" + System.getProperty("java.version"));
System.out.println("java.class.path:" + System.getProperty("java.class.path"));

Connection con = null;
Statement stmt = null;
ResultSet rs = null;

try{
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://" + HOST + ":3306/" + DB, USER, PASSWORD);
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT table_name FROM INFORMATION_SCHEMA.TABLES");

while (rs.next()) {

System.out.println(rs.getString(1));
}
}catch(SQLException e){
e.printStackTrace();
}catch(ClassNotFoundException e){
e.printStackTrace();
}finally{
try{rs.close();}catch(Exception e){}
try{stmt.close();}catch(Exception e){}
try{con.close();}catch(Exception e){}
}
}
}

Install Gnokii (Manage SMS on USB Stick)

# install
sudo apt-get install -y gnokii
# set permissions (TODO set permissions with udev)
sudo chmod o+rw /dev/ttyUSB0
# configure
cat < .gnokiirc

[global]
model = AT
port = /dev/ttyUSB0
connection = serial
EOF

# show sms status

gnokii --showsmsfolderstatus

# show sms

gnokii --getsms MT 0 end

# show sms and filter for "http"

gnokii --getsms MT 0 2> /dev/null | grep http

# delete sms

gnokii --deletesms MT 0

# Links

http://linuxgazette.net/164/tomar.html
http://wiki.gnokii.org/index.php/SMS_options
http://ubuntuforums.org/showthread.php?t=1123538

Pagination

  • First page
  • Previous page
  • …
  • Page 25
  • Page 26
  • Page 27
  • Page 28
  • Page 29
  • Page 30
  • Page 31
  • Page 32
  • Page 33
  • …
  • Next page
  • Last page
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung