- Set keyboard layout with
setxkbmap <lang>
- Update package repo with
sudo apt update
- Install sshd and vim with
sudo apt install openssh-server vim
- Update sshd config with
sudo vim /etc/ssh/sshd_config
- Set
PermitRootLogin yes
- Set
PasswordAuthentication yes
- Set
- Set password for root with
sudo passwd root
- Restart SSHD service
sudo systemctl restart ssh.service
- Login via ssh to machine
Resize a LUKS encrypted root partition
- Resizing the partition used by the encrypted volume
parted /dev/sda
(parted) print
[...]
Number Start End Size File system Name Flags
1 1049kB 525MB 524MB fat16 EFI system partition boot, esp
2 525MB 256GB 256GB Linux filesystem
(parted) resizepart
Partition number? 2
End? [512GB]? '100%'
(parted) print
[...]
Number Start End Size File system Name Flags
1 1049kB 525MB 524MB fat16 EFI system partition boot, esp
2 525MB 512GB 512GB Linux filesystem
(parted) q
- Boot machine from a bootable USB linux system (Arch Linux-, Ubuntu or similar USB installer)
- Open and resizing the encrypted LUKS volume
cryptsetup open /dev/sdb1 sdb1_crypt
cryptsetup resize sdb1_crypt
- Resize the physical device
pvresize /dev/mapper/sdb1_crypt
- Resize the logical device
lvextend -l +100%FREE /dev/mapper/vg-root
- Resizing the file-system of the volume
resize2fs /dev/mapper/vg-root
- Reboot. You are done.
Compile and use Proxmark3 on NixOS (nix-shell)
To compile and use proxmark3 on NixOS you need some packages. I created a nix-shell file with all needed dependencies.
Copy this file as shell.nix
to the cloned proxmark3 folder and run sudo nix-shell
. Continue then the normal compile guide.
with (import <nixpkgs> {});
mkShell {
buildInputs = [
lz4
readline
bzip2
ocamlPackages.ssl
gcc-arm-embedded
];
}
Examples
Proxmark Version/HW Info/Test connection
hw ver
Clone EM4100 to T5577 (Iceman Repo)
lf search
lf em 410x clone --id 0011223344
lf em 410x reader
Clone EM4100 to T5577 (Offical Repo)
lf search
lf em 410xwrite 0011223344 1
lf em 410xread
How to downgrade Unifi Controller Software
- You need a backup file from the version you want to downgrade. If you haven`t, you can stop here.
- SSH into your controller
ssh {user}@{controller-ip}
- Removed existing downloads
rm -f unifi_sysvinit_all.deb*
- Uninstall current controller package
apt purge unifi -y
- Download old controller package (replace version in url with your needs)
wget https://dl.ui.com/unifi/6.5.54/unifi_sysvinit_all.deb
- Install package
dpkg -i unifi_sysvinit_all.deb
- Remove download
rm unifi_sysvinit_all.deb
- Access UniFi Controller WebUI and restore backup
Useful information about NixOS
Since a few years i use NixOS as my favorite Linux distribution. NixOS is a Linux distribution based on the Nix package manager and build system. It supports reproducible and declarative system-wide configuration management as well as atomic upgrades and rollbacks, although it can additionally support imperative package and user management. See NixOS Wiki.
Upgrade to new version
- Review the NixOS release notes to ensure you account for any changes that need to be done manually. In particular, sometimes options change in backward-incompatible ways.
-
sudo nix-channel --add https://nixos.org/channels/nixos-22.05 nixos
(Change version tag if necessary) -
sudo nix-channel --update
-
nixos-rebuild --upgrade boot
-
Reboot to enter your newly-built NixOS.
It‘s perfectly fine and recommended to leave system.stateVersion
value in the configuration at the release version of the first install of this system. You should only bump this option, if you are sure that you can or have migrated all state on your system which is affected by this option. Before changing this value read the documentation for this option (e.g. man configuration.nix or on NixOS Options).
[via]https://unix.stackexchange.com/a/491772[/via]
Clean up system
sudo nix-collect-garbage --delete-older-than 30d
[via]https://matthewrhone.dev/nixos-package-guide#cleanup-old-packages-user-wide[/via]
Upgrade Kernel to latest version
- Add
boot.kernelPackages = pkgs.linuxPackages_latest;
to your configuration.nix
Use pipewire for Audio (with Bluetooth)
sound.enable = false;
hardware.pulseaudio = {
enable = false;
package = pkgs.pulseaudioFull;
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
config.pipewire = {
"context.properties" = {
#"link.max-buffers" = 64;
"link.max-buffers" = 16; # version < 3 clients can't handle more than this
"log.level" = 2; # https://docs.pipewire.org/#Logging
#"default.clock.rate" = 48000;
#"default.clock.quantum" = 1024;
#"default.clock.min-quantum" = 32;
#"default.clock.max-quantum" = 8192;
};
media-session.config.bluez-monitor.rules = [
{
# Matches all cards
matches = [ { "device.name" = "~bluez_card.*"; } ];
actions = {
"update-props" = {
"bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ];
# mSBC is not expected to work on all headset + adapter combinations.
"bluez5.msbc-support" = true;
# SBC-XQ is not expected to work on all headset + adapter combinations.
"bluez5.sbc-xq-support" = true;
};
};
}
{
matches = [
# Matches all sources
{ "node.name" = "~bluez_input.*"; }
# Matches all outputs
{ "node.name" = "~bluez_output.*"; }
];
actions = {
"node.pause-on-idle" = false;
};
}
];
};
};
Add a power LED to a Weller WE1010 soldering station
Some time ago I bought a Weller WE1010 soldering station. On all product photos it looks as if the display has a backlight - unfortunately this is not the case. Not even the on/off switch is illuminated, like on the old models. Shame on you Weller, that really goes better - especially for the price!
A backlight for the display would improve the readability enormously, but a retrofit is not so easy. I have instead installed a light under the on/off switch to see at least better whether the soldering station is switched on. I get the power directly from transformer, which supplies around 24V/AC. As LED i used this great Red 6mm 12-24V AC/DC LED.
Disclaimer
I assume no warranty or responsibility for any damage or injury. The conversion is at your own risk! When opening devices that are operated with mains voltage there is danger to life!
Parts
Assembly
- Open soldering station by removing the two screws on the back
- At this point, the housing can be carefully lifted with a flat screwdriver
- Then I removed the on/off switch and drilled a 6mm hole 12mm below the opening for the LED. Since there is so much space, one could think that Weller wanted to install an LED here - who knows?
- Insert the LED
- Protect LED cables with some tube
- Solder LED wires to the 24V output from the transformer
- Test and reassemble
Images
Video
Links
The links to AliExpress are advertising links. I would be happy if you use this link, but of course you don't have to. I have linked exactly the offers from which I have also bought and was satisfied with the supplier and the goods. The products can of course be bought anywhere.
Microsoft Outlook – Cannot delete this folder
After restoring an Exchange mailbox and sorting the mails, I wanted to delete the restore folder, but Outlook won't let me:
Cannot delete this folder. Right-click the folder, and then click Properties to check your petmissions for the folder, See the folder owner or your administrator to change your permissions, Shared folders cannot be deleted during synchronization with the server. Delete the folder after synchronization is finished
Solution: Move the folder to trash and then delete the folder.
Mikrotik RouterOS WireGuard dynamic DNS endpoint refresh
MikroTik RouterOS doesn't yet support DNS names for peer entpoints (v7.1.1). As a workaround, you can set the endpoint address using the CLI, but RouterOS will not re-resolve the DNS name. If the IP addresses behind the DNS name change at some point, for example if you use DDNS, the WireGuard tunnel will eventually stop working. As a solution, you can use a script that checks if the peer endpoint address still matches the dns name and if not, updates to the latest ip address of the DNS name.
Script:
Add under System > Scheduler a new script and choose a useful interval.
:local wgPeerComment
:local wgPeerDns
:set wgPeerComment "Peer #1 Comment"
:set wgPeerDns "dns.example.com"
:if ([interface wireguard peers get number=[find comment="$wgPeerComment"] value-name=endpoint-address] != [resolve $wgPeerDns]) do={
interface wireguard peers set number=[find comment="$wgPeerComment"] endpoint-address=[/resolve $wgPeerDns]
}
Example:
C/C++/Arduino Datatypes
Type | Byte | Bit | Typical Range |
---|---|---|---|
boolean | 1 | 8 | true/false |
char | 1 | 8 | -128 to 127 |
signed char | 1 | 8 | -128 to 127 |
unsigned char | 1 | 8 | 0 to 255 |
byte | 1 | 8 | 0 to 255 |
uint8_t | 1 | 8 | 0 to 255 |
int | 2 | 16 | -32,768 to 32,767 |
short | 2 | 16 | -32,768 to 32,767 |
signed int | 2 | 16 | -32,768 to 32,767 |
unsigned int | 2 | 16 | 0 to 65,535 |
word | 2 | 16 | 0 to 65,535 |
uint16_t | 2 | 16 | 0 to 65,535 |
long | 4 | 32 | -2,147,483,648 to 2,147,483,647 |
float | 4 | 32 | 3.4E +/- 38 (7 digits) |
unsigned long | 4 | 32 | 0 to 4,294,967,295 |
uint32_t | 4 | 32 | 0 to 4,294,967,295 |
double | 8 | 64 | 1.7E +/- 308 (15 digits) |
uint64_t | 8 | 64 | 0 to 18,446,744,073,709,551,615 |
Useful ffmpeg commands
Trim/Cut/Splitt Video
ffmpeg -i input.mp4 -c copy -ss 00:05:00 -to 00:10:00 output.mp4
- -c copy
Copy all streams
- -ss
Start time offset
- -to
Transcode stop time
(re)encode Video with h.254 and AAC
ffmpeg -i input.mp4 -vcodec h264 -acodec aac output.mp4
- -vcodec h264
Encodes video to h264
- -acodec aac
Encodes audio to aac
Resize Video to 1280x720 with high quality settings
ffmpeg -i input.mp4 -vf scale=1280:720 -preset slow -crf 18 output.mp4
- -vf scale=1280:720
Set video filter to resize to 1280x720
- -crf 18
Constant Rate Factor. A lower value means higher quality
Convert only Audio. EAC3 to AC3 for Example
ffmpeg -i "input.mkv" -map 0 -c:s copy -c:v copy -c:a ac3 output.mkv
- -map 0
Selects all streams. Otherwise only one stream per stream type will be selected.
- -c:s copy
Copy all subtitles.
- -c:v copy
Copy all video.
- -c:a ac3
Encodes all audio to AC-3.