This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Info ### | |
# This script freez inactive desktop applications to save CPU and bandwidth consumption. | |
# When you open some window then script unfreeze the window back. | |
# Apps wmctrl and xwininfo need installed before start this script. | |
# List all windows by `wmctrl -l -x -p` to get string which you will be use in grep_query (see below). | |
# Show window info by window id: xwininfo -id <window_id>. The command shows window states: IsViewable or IsUnMapped. | |
# Modify grep_query variable to get which, for example, windows classes you want to freeze. You can use windows title or part also. | |
# This script runs infinitely with timeout 3 sec. Press Ctrl-C or kill him. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Error output: | |
// ... | |
// desctructed: 32631 | |
// desctructed: 32632 | |
// core.thread.threadbase.ThreadError@src/core/thread/threadbase.d(1217): Error creating thread | |
module test.thread; | |
import std.stdio; | |
import core.thread.osthread; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module multithread.semaphore.test; | |
import std.stdio; | |
import core.sync.semaphore; | |
import core.thread.osthread; | |
import core.time; | |
import std.random; | |
import std.conv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module singleton_test; | |
import std.stdio; | |
import core.thread.osthread; | |
void main() { | |
testSingletonMultithread(); | |
} | |
class Singleton1 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.util.ArrayList; | |
import java.util.List; | |
// Results (AMD Ryzen 7 5800H) | |
// JDK 17 (OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05, mixed mode, sharing) | |
// generateRandomData > | |
// end generateRandomData (2937 ms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo '{"bondings": {}, "networks": {"ovirtmgmt": {"nic": "eth0", "netmask": "255.255.255.0", "ipaddr": "1.1.1.2", "gateway": "1.1.1.1", "defaultRoute": true}}, "options": {"connectivityCheck": false}}' | vdsm-client -f - Host setupNetworks | |
vdsm-client Host setSafeNetworkConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# != 1 ]; then | |
printf "Usage: \n ./gpged file\n" | |
exit 1 | |
fi | |
echo "Tip: run this script under separate user or root to make tmpfile unreadable for others" | |
FILE=$1 |