First big articles reformatting now that I properly understand hugo

This commit is contained in:
Julien Dessaux 2021-03-11 19:47:26 +01:00
parent 5e6844592a
commit 1a4981a826
40 changed files with 184 additions and 173 deletions

View file

@ -1,5 +0,0 @@
---
title: "Commands"
linkTitle: "Commands"
weight: 40
---

View file

@ -1,11 +1,13 @@
---
title: "List active calls on asterisk"
linkTitle: "List active calls on asterisk"
date: 2018-09-25
description: >
How to show active calls on an asterisk system
description: How to show active calls on an asterisk system
tags:
- asterisk
---
## Using the cli
{{< highlight yaml >}}
watch -d -n1 'asterisk -rx “core show channels”'
{{< /highlight >}}

View file

@ -1,11 +1,13 @@
---
title: "How to have asterisk call you into a meeting"
linkTitle: "How to have asterisk call you into a meeting"
date: 2018-09-25
description: >
How to have asterisk call you itself into a meeting
description: How to have asterisk call you itself into a meeting
tags:
- asterisk
---
## Using the cli
At alterway we sometimes have DTMF problems that prevent my mobile from joining a conference room. Here is something I use to have asterisk call me
and place me inside the room :

View file

@ -1,12 +1,15 @@
---
title: "Busybox web server"
linkTitle: "Busybox web server"
date: 2019-04-16
description: >
Busybox web server
description: How to serve static files from only busybox
tags:
- linux
- simple utilities
---
If you have been using things like `python -m SimpleHTTPServer`, here is something even more simple and lightweight to use :
## The command
If you have been using things like `python -m SimpleHTTPServer` to serve static files in a pinch, here is something even more simple and lightweight to use :
{{< highlight sh >}}
busybox httpd -vfp 80

View file

@ -1,12 +1,14 @@
---
title: "Capture a video of your desktop"
linkTitle: "Capture a video of your desktop"
date: 2011-11-20
description: >
Capture a video of your desktop
description: Capture a video of your desktop
tags:
- ffmpeg
---
You can capture a video of your linux desktop with ffmpeg :
## The command
You can capture a video of your linux desktop very easily with ffmpeg :
{{< highlight sh >}}
ffmpeg -f x11grab -s xga -r 25 -i :0.0 -sameq /tmp/out.mpg

View file

@ -1,12 +1,14 @@
---
title: "Clean conntrack states"
linkTitle: "Clean conntrack states"
date: 2018-03-02
description: >
Clean conntrack states
description: How to clean conntrack states
tags:
- linux
---
Here is an example of how to clean conntrack states that match a specific query on a linux firewall :
## A not so simple command
Firewalling on linux is messy, here is an example of how to clean conntrack states that match a specific query on a linux firewall :
{{< highlight sh >}}
conntrack -L conntrack -p tcp orig-dport 65372 | \

View file

@ -1,12 +1,14 @@
---
title: "Convert unix timestamp to readable date"
linkTitle: "Convert unix timestamp to readable date"
date: 2011-01-06
description: >
Convert unix timestamp to readable date
description: the -d flag of the date command combined with @timestamp
tags:
- simple utilities
---
As I somehow have a hard time remembering this simple date flags as I rarely need it, I decided to write it down here :
## The trick
I somehow have a hard time remembering this simple date flags *(probably because I rarely get to practice it), I decided to write it down here :
{{< highlight sh >}}
$ date -d @1294319676

View file

@ -1,12 +1,14 @@
---
title: "DMIdecode"
linkTitle: "DMIdecode"
date: 2011-02-16
description: >
DMIdecode
description: Some DMIdecode common flags
tags:
- simple utilities
---
DMIdecode to obtain Hardware informations.
## Introduction
DMIdecode is a tool to obtain Hardware informations.
## Mose useful commands

View file

@ -1,12 +1,12 @@
---
title: "Find hardlinks to a same file"
linkTitle: "Find hardlinks to a same file"
date: 2018-03-02
description: >
Find hardlinks to a same file
description: How to list hardlinks that link to the same file
tags:
- find
- simple utilities
---
{{< highlight sh >}}
find . -samefile /path/to/file
{{< /highlight >}}

View file

@ -1,12 +1,12 @@
---
title: "Find where inodes are used"
linkTitle: "Find where inodes are used"
date: 2018-04-25
description: >
Find where inodes are used
description: How to locate what is taking all the inodes in the subdirectory of a given device
tags:
- find
- simple utilities
---
{{< highlight sh >}}
find . -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n
{{< /highlight >}}

View file

@ -1,13 +1,14 @@
---
title: "Import commits from one git repo to another"
linkTitle: "Import commits from one git repo to another"
date: 2018-09-25
description: >
Import commits from one git repo to another
description: How to take commits from one git repo and bring them into another
tags:
- git
---
This imports commits from a repo in the `../masterfiles` folder and applies them to the repository inside the current folder :
## The trick
In an ideal world there should never be a need to do this, but here is how to do it properly if you ever walk into this bizarre problem. This command imports commits from a repo in the `../masterfiles` folder and applies them to the repository inside the current folder :
{{< highlight sh >}}
(cd ../masterfiles/; git format-patch stdout origin/master) | git am
{{< /highlight >}}

View file

@ -1,13 +1,14 @@
---
title: "Rewrite a git commit history"
linkTitle: "Rewrite a git commit history"
date: 2018-03-05
description: >
Rewrite a git commit history
description: How to rewrite a git commit history
tags:
- git
---
## git filter-branch
Here is how to rewrite a git commit history, for example to remove a file :
{{< highlight sh >}}
git filter-branch index-filter "git rm --cached --ignore-unmatch ${file}" --prune-empty --tag-name-filter cat - -all
{{< /highlight >}}

View file

@ -1,11 +1,12 @@
---
title: "ipmitool"
linkTitle: "ipmitool"
date: 2018-03-05
description: >
ipmitool
description: some ipmitool command examples
tags:
- simple utilities
---
## Usage examples
- launch ipmi shell : `ipmitool -H XX.XX.XX.XX -C3 -I lanplus -U <ipmi_user> shell`
- launch ipmi remote text console : `ipmitool -H XX.XX.XX.XX -C3 -I lanplus -U <ipmi_user> sol activate`
- Show local ipmi lan configuration : `ipmitool lan print`
@ -16,4 +17,3 @@ ipmitool lan set 1 ipaddr 10.31.149.39
ipmitool lan set 1 netmask 255.255.255.0
mc reset cold
{{< /highlight >}}

View file

@ -1,9 +1,10 @@
---
title: "mdadm"
linkTitle: "mdadm"
date: 2011-11-15
description: >
mdadm
description: some mdadm command examples
tags:
- linux
- simple utilities
---
## Watch the array status
@ -39,4 +40,3 @@ mdadm --stop /dev/md0
mdadm --zero-superblock /dev/sda
mdadm --zero-superblock /dev/sdb
{{< /highlight >}}

View file

@ -1,11 +1,11 @@
---
title: "MegaCLI"
linkTitle: "MegaCLI"
date: 2018-03-05
description: >
MegaCLI for dell hardware investigations
description: MegaCLI for dell hardware investigations
tags:
- linux
---
## Some command examples
- `megacli -LDInfo -LALL -aALL|grep state`
- `MegaCli -PDlist -a0|less`

View file

@ -1,9 +1,9 @@
---
title: "omreport"
linkTitle: "omreport"
date: 2018-03-05
description: >
omreport
description: Some omreport command examples
tags:
- linux
---
## Your raid status at a glance
@ -17,4 +17,3 @@ omreport storage vdisk
omreport storage pdisk controller=0 vdisk=0
omreport storage pdisk controller=0 pdisk=0:0:4
{{< /highlight >}}

View file

@ -1,11 +1,14 @@
---
title: "qemu-nbd"
linkTitle: "qemu-nbd"
date: 2019-07-01
description: >
qemu-nbd
description: qemu-nbd usage example
tags:
- linux
- virtualization
---
## Usage example
{{< highlight sh >}}
modprobe nbd max_part=8
qemu-nbd -c /dev/nbd0 image.img
@ -14,4 +17,3 @@ mount /dev/nbd0p1 /mnt # or vgscan && vgchange -ay
umount /mnt
qemu-nbd -d /dev/nbd0
{{< /highlight >}}

View file

@ -1,9 +1,10 @@
---
title: "Qemu"
linkTitle: "Qemu"
date: 2019-06-10
description: >
Qemu
description: Some simple qemu command usage
tags:
- linux
- virtualization
---
## Quickly launch a qemu vm with local qcow as hard drive

View file

@ -1,9 +1,9 @@
---
title: "rrdtool"
linkTitle: "rrdtool"
date: 2018-09-25
description: >
rrdtool
description: How to graph manually with rrdtool
tags:
- simple utilities
---
## Graph manually