| Recent Questions - Unix & Linux Stack Exchange Posted: 15 Jul 2022 04:46 PM PDT | How to set bash script parameter to file minus the extension Posted: 15 Jul 2022 04:37 PM PDT so I have this bash file called test.sh #!/bin/bash -l out_file=`basename "$0"` #SBATCH --gpus=1 #SBATCH -p long #SBATCH -o err_${out_file::-3}.out and I want to output the error to err_test.out, which is what I'm trying to do in the above file, but it's giving an error. Doesn't like the = how can I set the output file to the file name I specified. | | How do I resolve an error with the pNFS mapping daemon? Posted: 15 Jul 2022 03:52 PM PDT I get an annoying error on my Ubuntu Server installation with nfs-blkmap. Running the command ~$ systemctl status nfs-blkmap.service Yields the following × nfs-blkmap.service - pNFS block layout mapping daemon Loaded: loaded (/lib/systemd/system/nfs-blkmap.service; enabled; vendor preset: enabled) Active: failed (Result: protocol) since Wed 2022-07-13 16:16:36 UTC; 2 days ago CPU: 1ms Jul 13 16:16:36 homeserver systemd[1]: Starting pNFS block layout mapping daemon... Jul 13 16:16:36 homeserver blkmapd[1511]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory Jul 13 16:16:36 homeserver systemd[1]: nfs-blkmap.service: New main PID 1511 does not exist or is a zombie. Jul 13 16:16:36 homeserver systemd[1]: nfs-blkmap.service: Failed with result 'protocol'. Jul 13 16:16:36 homeserver systemd[1]: Failed to start pNFS block layout mapping daemon. I'll admit I haven't done much except some googling because I'm kinda afraid to mess up something. Could someone help me out? | | Possible missing firmware although firmware is installed Posted: 15 Jul 2022 04:10 PM PDT I get missing firmware messages although firmware is installed (on Debian bookworm). sudo update-initramfs -u update-initramfs: Generating /boot/initrd.img-5.18.0-2-amd64 W: Possible missing firmware /lib/firmware/i915/skl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/bxt_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/glk_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/cml_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/icl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/dg1_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/adlp_guc_69.0.3.bin for module i915 W: Possible missing firmware /lib/firmware/i915/adlp_dmc_ver2_14.bin for module i915 I followed this solution Possible missing firmware /lib/firmware/i915/* for module i915 apt-file search says for all lines above that firmware-misc-nonfree is missing: apt-file search tgl_guc apt-file search skl_guc apt-file search bxt_guc apt-file search kbl_guc apt-file search glk_guc apt-file search kbl_guc apt-file search kbl_guc apt-file search cml_guc apt-file search icl_guc apt-file search ehl_guc apt-file search ehl_guc apt-file search tgl_guc apt-file search tgl_guc apt-file search dg1_guc apt-file search tgl_guc apt-file search adlp_guc apt-file search adlp_dmc_ver2_14.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_32.0.3.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_33.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver1.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver4.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver6.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver6_1.bin firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver9_33.bin firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_32.0.3.bin firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_33.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_ver8_7.bin firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_ver9_29.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_32.0.3.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_33.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_14.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_39.bin firmware-misc-nonfree: /lib/firmware/i915/glk_guc_32.0.3.bin firmware-misc-nonfree: /lib/firmware/i915/glk_guc_33.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/glk_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/glk_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_32.0.3.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_33.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_14.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_39.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_32.0.3.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_33.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_14.bin firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_39.bin firmware-misc-nonfree: /lib/firmware/i915/cml_guc_33.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/cml_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/cml_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/icl_guc_32.0.3.bin firmware-misc-nonfree: /lib/firmware/i915/icl_guc_33.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/icl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/icl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_33.0.4.bin firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_33.0.4.bin firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_35.2.0.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_35.2.0.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/dg1_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/dg1_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_35.2.0.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_49.0.1.bin firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_62.0.0.bin firmware-misc-nonfree: /lib/firmware/i915/adlp_guc_62.0.3.bin So I installed firmware-linux, firmware-linux-nonfreeand firmware-misc-nonfree they were indeed missing. But after installing them, the messages does not go away. What am I missing here? | | Dev loop0: unable to read RDB block 8 Posted: 15 Jul 2022 03:58 PM PDT Every time I boot my laptop I see this warning and from dmesg I get this output: [ 2.895604] Dev loop0: unable to read RDB block 8 [ 2.895641] loop0: unable to read partition table [ 2.895936] loop0: partition table beyond EOD, truncated What does this warning means? Should I be worried? I have an SSD and it seems to be working well. I saw that RDB means Rigid Disk Block from Wikipedia. When I run fdisk -l I get Disc /dev/loop0: 4 KiB, 4096 bytes, 8 sectors Unities: sector of 1 * 512 = 512 bytes Sector size (logic/physic): 512 bytes / 512 bytes I/O size (minimal/optimal): 512 bytes / 512 bytes | | (n)vi - Erase in ex mode Posted: 15 Jul 2022 03:22 PM PDT How does one erase characters in ex mode (':' command line) of (n)vi 1.79 or make 'Backspace' behave as in Vim? 'Backspace' and 'Delete' only move the cursor left, from where new keystrokes overwrite instead of preferably inserting. This is the same for insert mode, but I can use 'Esc' to clear everything after the cursor; 'Backspace' does erase at the shell command line. I am using (n)vi in xterm in fvwm, each of which are included in a new OpenBSD 7.1 installation. Note that Vim and its vi command, i.e. :set compatible, are not the same implementation as (n)vi. Some places I have searched: | | error: *** A compiler with support for C++11 language features is required Posted: 15 Jul 2022 02:24 PM PDT I want to Build GCC 11 from source on Ubuntu 20.04. I had some problems in making package for ROS and hence I decide to update my GNU. my gcc and g++ versions are 11.1.0 when I extract the downloaded version of gcc and try to configure it with ../gcc-releases-gcc-11.1.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-11.1.0 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-11.1 I encounter below error: checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /usr/bin/sed checking for gawk... no checking for mawk... mawk checking for libatomic support... yes checking for libitm support... yes checking for libsanitizer support... yes checking for libvtv support... yes checking for libhsail-rt support... yes checking for libphobos support... yes checking for x86_64-linux-gnu-gcc... x86_64-linux-gnu-gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether x86_64-linux-gnu-gcc accepts -g... yes checking for x86_64-linux-gnu-gcc option to accept ISO C89... none needed checking whether we are using the GNU C++ compiler... no checking whether /usr/bin/gcc-11.1.0 accepts -g... no checking whether g++ accepts -static-libstdc++ -static-libgcc... no checking for x86_64-linux-gnu-gnatbind... no checking for gnatbind... no checking for x86_64-linux-gnu-gnatmake... no checking for gnatmake... no checking whether compiler driver understands Ada... no checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 checking whether /usr/bin/gcc-11.1.0 supports C++11 features by default... no checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=gnu++11... no checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=gnu++0x... no checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=c++11... no checking whether /usr/bin/gcc-11.1.0 supports C++11 features with +std=c++11... no checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -h std=c++11... no checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=c++0x... no checking whether /usr/bin/gcc-11.1.0 supports C++11 features with +std=c++0x... no checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -h std=c++0x... no configure: error: *** A compiler with support for C++11 language features is required. I searched a lot but I could not solve. Do you have any suggestion? Thank you | | BitTorrent etiquette with multiple nodes Posted: 15 Jul 2022 02:33 PM PDT I have two BitTorrent nodes running, one of which is on a limited data connection. I know you're supposed to leave the node running long enough for it to upload as much as it has downloaded, but is it okay to close the one on the limited connection early if I leave the unlimited one running? | | How to permanently disable delayed Ack? Posted: 15 Jul 2022 12:53 PM PDT I have run in to the Nagle / Delayed ACK problem that causes 40ms overhead on small TCP packets. According to Redhat documentation I can add the quickack 1 option to the route and it will disable the Delayed ACK feature. So, this is what I did: [root@x]# ip route show default via 10.100.11.1 dev ens192 proto static metric 100 10.100.11.0/24 dev ens192 proto kernel scope link src 10.100.11.13 metric 100 And then I added the quickack option to my interface: [root@x]# ip route change 10.100.11.0/24 dev ens192 proto kernel scope link src 10.100.11.13 metric 100 quickack 1 This solved the problem. However, how do I make this change permanent? Or is this even the best method for disabling this feature? I tried to add 10.100.11.0/24 dev ens192 proto kernel scope link src 10.100.11.13 metric 100 quickack 1 to /etc/sysconfig/network-scripts/route-ens192 but it did not persist. I am using RHEL 7.9. | | Up wlan as reserve channel if eth doesn't work Posted: 15 Jul 2022 12:50 PM PDT I have a server (raspberrypi 4) which I don't have physical access and I want to have spare way to connect to internet. I want to server used eth0 to connect to router and to get internet, but when internet is not accessible by eth0 then up wlan and connect to router using wlan. | | Making a bash script apply to only selected files (Nautilus) Posted: 15 Jul 2022 02:00 PM PDT I'm trying to learn (with no programming background) to create some custom bash scripts for converting selected files from Nautilus, but I hit an issue I can't understand. For reference, this is a script that DOES work. It converts selected .MP4 files to .mkv, copies the time stamp and prints some feedback to the user. #!/bin/bash for i in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS do ffmpeg -i "$i" -movflags use_metadata_tags -c:v libx265 -crf 26 -preset slow -c:a aac -b:a 160k "${i%.*}.mkv" && touch -r "$i" "${i%.*}.mkv" && notify-send "Converted '$(basename "$i")'" || notify-send "Failed converting '$(basename "$i")'" done notify-send "Conversion finished" Now, this is a script that DOESN'T work. It should convert selected .m4a files to .mp3, add a cover image and some tags, copy the time stamp and give some feedback to the user. #!/bin/bash for i in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS do ffmpeg -i "$i" "${i%.*}.mp3" && eyeD3 -a "Author" -A "Album" --add-image="cover.jpg":FRONT_COVER "${i%.*}.mp3" && touch -r "$i" "${i%.*}.mp3" && notify-send "Converted '$(basename "$i")'" || notify-send "Failed converting '$(basename "$i")'" done notify-send "Conversion finished" When I run this one, I get multiple errors that say "Failed converting (a part of the path to the file)"... for some parts of the path to the file, like parts of folder and file names. I'm not sure what I'm doing differently here. I'm using the same $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS parameter, but it doesn't work the same in the second script. As a reference, this other script, which is the same as the second one but applies to all the files in the folder, does work perfectly, so I'm sure the commands inside do do work. #!/bin/bash for i in *.m4a do ffmpeg -i "$i" "${i%.*}.mp3" && eyeD3 -a "Author" -A "Album" --add-image="cover.jpg":FRONT_COVER "${i%.*}.mp3" && touch -r "$i" "${i%.*}.mp3" && notify-send "Converted '$(basename "$i")'" || notify-send "Failed converting '$(basename "$i")'" done notify-send "Conversion finished" What am I missing? Can the $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS only work with certain file types? Is the issue somewhere else? | | Why does /etc/resolv.conf keep changing? Posted: 15 Jul 2022 02:29 PM PDT I am running a debian based linux vm using virt-manager with two ethernet interfacs one connected with NAT and the other is bridged to br0, in /etc/network/interfaces I have the following configuration auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp br0 has a dhcp server that in not connected to anything except for a switch when I reboot the machine /etc/resolv.conf has the following entry nameserver 192.168.150.1 which is the network address assigned by NAP, that being said when I try to ping google.com I get the error temporary name resolution failure then I add another entry which is nameserver 8.8.8.8 and the vm works fine and I can visit any website but after some time it check /etc/resolv.conf and it has one entry again, even if i left the machine running with out starting anny services or running any programs Is there a way to find out what is overwriting /etc/resolv.conf Is there a wat to add nameserver 8.8.8.8 to /etc/resolv.conf if it is not found (without using bash files) | | dpkg-genbuildinfo: error: badly formed line in files list file, line 1 Posted: 15 Jul 2022 12:35 PM PDT I am trying to debianize a collection of shell scripts. The build itself is quite simple, as there are no binaries to build – every file that will be installed on the target system is already present in the source tree. Now the build process fails with an error message I cannot make sense of: dpkg-genbuildinfo: error: badly formed line in files list file, line 1 dpkg-buildpackage: error: dpkg-genbuildinfo subprocess returned exit status 25 debuild: fatal error at line 1182: dpkg-buildpackage -us -uc -ui failed What is the files list file mentioned in the error message – does that refer to the .install file? The file looks like this: src/main/shell/autorecover opt/autorecover src/main/shell/autorecover.d/lib/* opt/autorecover.d/lib/ src/main/shell/autorecover.d/mods-available/* opt/autorecover.d/mods-available/ The debian dir is copied and stripped down from another (more complex) package I built earlier, which completed without such errors iirc. Nonetheless, I do end up with a deb package which seems to have everything in place – scripts as well as files to install. (Which indicates that the .install file cannot have been all that wrong, at least the files are getting collected.) What is wrong here? What do I need to fix, or where should I start looking for the error? | | enable webmin scheduled package updates in config file Posted: 15 Jul 2022 03:34 PM PDT I'm deploying webmin across many servers using Terraform & cloud-init. I want to enable "Scheduled Upgrades" in the "Software Package Updates" module during setup by using a config file template. I can successfully configure the action and reporting email by including the following in /etc/webmin/package-updates/config : sched_email=sys.admin@... sched_action=2 However, there seems to be no entry for the schedule interval selection and enabling it. What other config file (if any) is this info stored in? I've also tried using the webmin CLI but couldn't figure out the correct option name: # webmin set-config -m package-updates -o schedule -value 1 # Error: Option 'schedule' is unknown in module package-updates | | .NET SDK wouldn't show up on Fedora 36 Posted: 15 Jul 2022 01:51 PM PDT Installed .NET and its dependencies by running sudo dnf install dotnet After executing dotnet --info Host (useful for support): Version: 6.0.6 Commit: 7cca709db2 .NET SDKs installed: No SDKs were found. .NET runtimes installed: Microsoft.AspNetCore.App 6.0.6 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.6 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download it showed no installed SDKs. Reinstalled (it was installed) dotnet-sdk-6.0. sudo dnf reinstall dotnet-sdk-6.0 Reinstalled successfully, still won't show up. Even tried sudo dnf install dotnet-sdk-6.0.x86_64 No result after installation. dotnet --info Shows that no SDKs are installed, even though they are. Please help me or show me my mistake. | | rsyslog: how to cut string from starting field to end of message Posted: 15 Jul 2022 01:41 PM PDT i have some messy devices which i want to handle trough rsyslog 90% of job is done, but i am stuck here rawmsg: '<133>2022-07-15 17:11:11 eleservice-sw02 51891 Logout the web by admin on web (169.254.101.1).' rawmsg: '<133>2022-07-15 17:11:14 eleservice-sw02 51890 Login the web by admin on web (169.254.101.1).' rawmsg: '<132>2022-07-15 18:10:14 piknov29-sw42 43557 CPU RISING THRESHOLD: Total CPU Utilization is 83%.' so my question is how to select string from Field nr 5 (F,32:5) until end of line ? | | Isolate sub-string after a certain pattern Posted: 15 Jul 2022 01:53 PM PDT I have a line in a file like this: <TD><TR> monogram ended in 1 </TD></TR> monogram ended in is always constant but not the 1, this number changes always and can be up to a 3-digit number. So I need a command to search for monogram ended in and get the number after thit string. Can anyone help me here. | | rename the header of multifasta files Posted: 15 Jul 2022 11:49 AM PDT I have multi-fast files like this >aaaaa.1_prot_CAA66754.1_10 MEKLLDAYLSSLRLNRRQVSEQTGLNYTTLQRASDKDALMISPRILWGIAMMVDKTPGQVLDELIELEMK >bbbbb.1_prot_CAA66753.1_11 MMSKQDRINRRRRNIMKDAHRIAKLIVSNVGDYMVAMKLALKTVYAYKAMRKEVSSRGNAVEMHTLPLLD GYARQQFEPEFVAGIPAWAIKKDFMSSSAQDILYFTIDTKVVKETEKAVEIEFATKNPKEHGYVDHHHTW VAKSIMAA I want to rename the header like this by sed or awk >aaaaa.1_10 MEKLLDAYLSSLRLNRRQVSEQTGLNYTTLQRASDKDALMISPRILWGIAMMVDKTPGQVLDELIELEMK >bbbbb.1_11 MMSKQDRINRRRRNIMKDAHRIAKLIVSNVGDYMVAMKLALKTVYAYKAMRKEVSSRGNAVEMHTLPLLD GYARQQFEPEFVAGIPAWAIKKDFMSSSAQDILYFTIDTKVVKETEKAVEIEFATKNPKEHGYVDHHHTW VAKSIMAA but I just know sed a little, like sed 's/.\(.\)$/\1/' to remove the penultimate letter of each line. Can you give me some advice? | | How does the tilde expansion work within a shell variable? Posted: 15 Jul 2022 01:01 PM PDT I came across something funny when testing my script. I can ls my directory from the shell manually if I run $ ls ~/db_backups/ test1 test2 $ However, if I assign a shell variable a dir location as such with the tilde, it doesn't work. I tried this with both single and double quotes. $ backupfolder='~/db_backups' $ echo $backupfolder ~/db_backups $ ls $backupfolder ls: cannot access '~/db_backups': No such file or directory $ What is happening with the tilde substitution inside the shell variable? Why can't I ls the directory thru the variable like I can manually with the tilde in the dir name? | | How do I stop random Hibernation/sleep? (Ubuntu Desktop 18.04) Posted: 15 Jul 2022 03:02 PM PDT Ubuntu Desktop running 18.04 with sleep and hibernation turned off, no monitor/keyboard plugged in, been running now for several weeks with a few custom services perfectly fine. This morning it was not responding via ssh, and the services were not talking to a cloud application. I had to restart the machine to get access to any logs. A custom service ran just half a second before this log, so the machine was still active. Some help how to stop this random sleep/hibernation would be great. Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1230] manager: sleep: sleep requested (sleeping: no enabled: yes) Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1236] manager: NetworkManager state is now ASLEEP Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1253] device (enp1s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed') Feb 02 06:54:00 home whoopsie[1025]: [06:54:00] offline Feb 02 06:54:00 home gnome-shell[859]: Screen lock is locked down, not locking Feb 02 06:54:00 home dbus-daemon[662]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.15' (uid=0 pid=709 comm="/usr/sbin/Network Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1615] device (enp1s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed') Feb 02 06:54:00 home avahi-daemon[684]: Withdrawing address record for xxx on enp1s0. Feb 02 06:54:00 home avahi-daemon[684]: Leaving mDNS multicast group on interface enp1s0.IPv6 with address xxx. Feb 02 06:54:00 home avahi-daemon[684]: Interface enp1s0.IPv6 no longer relevant for mDNS. Feb 02 06:54:00 home systemd[1]: Starting Network Manager Script Dispatcher Service... Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1970] dhcp4 (enp1s0): canceled DHCP transaction, DHCP client pid 968 Feb 02 06:54:00 home dbus-daemon[662]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher' Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.1971] dhcp4 (enp1s0): state changed bound -> done Feb 02 06:54:00 home systemd[1]: Started Network Manager Script Dispatcher Service. Feb 02 06:54:00 home nm-dispatcher[24574]: req:1 'connectivity-change': new request (1 scripts) Feb 02 06:54:00 home avahi-daemon[684]: Withdrawing address record for 192.168.4.44 on enp1s0. Feb 02 06:54:00 home nm-dispatcher[24574]: req:1 'connectivity-change': start running ordered scripts... Feb 02 06:54:00 home avahi-daemon[684]: Leaving mDNS multicast group on interface enp1s0.IPv4 with address 192.168.4.44. Feb 02 06:54:00 home avahi-daemon[684]: Interface enp1s0.IPv4 no longer relevant for mDNS. Feb 02 06:54:00 home NetworkManager[709]: <info> [1612248840.2066] device (enp1s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed') Feb 02 06:54:00 home kernel: r8169 0000:01:00.0 enp1s0: Link is Down Feb 02 06:54:00 home nm-dispatcher[24574]: req:2 'down' [enp1s0]: new request (1 scripts) Feb 02 06:54:00 home nm-dispatcher[24574]: req:2 'down' [enp1s0]: start running ordered scripts... Feb 02 06:54:00 home systemd[1]: Reached target Sleep. Feb 02 06:54:00 home systemd[1]: Starting Hybrid Suspend+Hibernate... Feb 02 06:54:00 home kernel: PM: Image not found (code -22) Feb 02 06:54:00 home systemd-sleep[24587]: Suspending system... Feb 02 06:54:00 home kernel: PM: hibernation entry This was also the power setting during this time :/home/me# su - gdm -s /bin/bash :~$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing' :~$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing' :~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing' :~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0 :~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 1200 | | How can I attach to the the first unattached tmux session, or create a new session if there are no unattached sessions? Posted: 15 Jul 2022 12:55 PM PDT How can I attach to the the first tmux session that has no attached clients or, if there are no unattached sessions, create a new session and attach to that? (The use case is for a command for my terminal emulator to run when opening a new terminal window. I don't want it to create a new session each time I open a window, if there are detached sessions lying around. Nor do I want it to re-attach to the same named session every time, if there's already a window attached to that session. I want it to recycle existing unattached sessions but create new sessions when there are none unattached.) | | Manjaro MySQL - mariadb.service fails when trying to start Posted: 15 Jul 2022 02:01 PM PDT When trying to start MariaDB with systemctl status mariadb, I get: ● mariadb.service - MariaDB 10.3.15 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since (date) Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Process: 2512 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 2513 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS) Process: 2521 ExecStart=/usr/bin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE) Main PID: 2521 (code=exited, status=1/FAILURE) Status: "Starting final batch to recover 13 pages from redo log" [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded [Note] Recovering after a crash using tc.log [Note] Starting crash recovery... [Note] Crash recovery finished. [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist [Note] Server socket created on IP: '::'. [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist mariadb.service: Main process exited, code=exited, status=1/FAILURE mariadb.service: Failed with result 'exit-code'. Failed to start MariaDB 10.3.15 database server. Through following so many various tutorials, I think I've also made it worse. I can't run mysql anymore (in the context of mysql < file.sql), since it says mysql: command not found. I've tried removing, reinstalling mariadb and rebooting my computer in between; but I'm out of luck. Any ideas? EDIT: A lot of other people seem to be having this problem, and while it's been >1 year and I don't recall what I did next, I do know that following the Arch Wiki page LINE BY LINE will guarantee a proper install. The formatting of the page made me read over things (important things were small, optional things were bold), but make sure you do that right and your installation should work. | | Download error with youtube-dl and axel Posted: 15 Jul 2022 12:04 PM PDT I am trying to download following video: https://www.youtube.com/watch?v=pQWj2Fgxdrc by combining 'youtube-dl' and 'axel'. I am trying to download this video in such a way that I want these two softwares (youtube-dl and axel) to not only save this video as "interview.mp4" but also limit download speed to 200KB. For this purpose, I used following command: youtube-dl -f 22 -c -i --external-downloader /usr/bin/axel -o 'interview.mp4' -s 200000 https://www.youtube.com/watch?v=pQWj2Fgxdrc Here I am using following options: -f 22 for video format -c for resume download -i for ignore errors -o for output file name -s 200000 for limit download speed to 200KB However, instead of downloading the video at 200KB and saving it as "interview.mp4", it is giving following error: ERROR: fixed output name but more than one file to download I have also tried following variation of command: youtube-dl -f 22 -c -i --external-downloader /usr/bin/axel -s 200000 -o 'interview.mp4' https://www.youtube.com/watch?v=pQWj2Fgxdrc and youtube-dl -f 22 -c -i --external-downloader /usr/bin/axel -o 'interview.mp4' https://www.youtube.com/watch?v=pQWj2Fgxdrc -s 200000 and youtube-dl -f 22 -c -i -o 'interview.mp4' --external-downloader /usr/bin/axel -s 200000 https://www.youtube.com/watch?v=pQWj2Fgxdrc But still same error is appearing. However, if I remove the option (-s 200000), the error disappear and the video starts to download. But I want to use (-s 200000) option so that it should not eat all the bandwidth. What mistake I am doing here? | | Can't connect to remote server using RDP remmina after upgrade Posted: 15 Jul 2022 03:07 PM PDT I recently upgraded my Ubuntu to 18.04, and now my Remmina cannot connect to a windows server we use at work. Now I am getting a popup about certificates. It asks if I want to accept the certificate, I click OK and then get a message saying unable to connect. I am getting this error on the command line: [14:49:19:412] [7223:7537] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr [14:49:19:412] [7223:7537] [INFO][com.freerdp.client.common.cmdline] - loading channelEx drdynvc [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - @ WARNING: CERTIFICATE NAME MISMATCH! @ [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - The hostname used for this connection (xxxxx:3389) [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - does not match the name given in the certificate: [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - Common Name (CN): [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - EC2AMAZ-FM25IO2 [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - A valid certificate for the wrong name should NOT be trusted! [14:50:38:624] [7223:7537] [ERROR][com.freerdp.crypto] - certificate not trusted, aborting. [14:50:38:624] [7223:7537] [ERROR][com.freerdp.core] - freerdp_set_last_error ERRCONNECT_CONNECT_CANCELLED [0x0002000B] [14:50:38:624] [7223:7537] [ERROR][com.freerdp.core.connection] - Error: protocol security negotiation or connection failure 0002000B 00000003 Now this is an internal vpn server so I don't care at all about certificates. Is there a way to add this certificate to a list that it's ok? How do I get around this? And as an aside, this was working before the upgrade just fine. I don't know why it cares now? | | Warning: mongodb.service changed on disk. Run systemctl daemon-reload to reload Posted: 15 Jul 2022 02:13 PM PDT I'm installing Modern Honey Network but every time I get to the command sudo ./install.sh I end up with this error Warning: mongodb.service changed on disk. Run systemctl daemon-reload to reload and I don't know how to get past that, any help would be appreciated. I'm supposed to get a configuration page after the installation but I can't get there because of this error. | | How do I disable my CD/DVD drive? Posted: 15 Jul 2022 04:01 PM PDT I'd like to disable my CD/DVD drive so that it doesn't spin up every time I select Save in my Kate editor, or select a file-accessing action in other applications. The spinning up just delays what I'm doing, and I'm not even using the DVD drive. I want to leave the CD in the drive, and not have it spin up. I found a website that said a udev rule will definitely disable the drive. So far, I've tried the following 2 rules (separately), but neither of them disable the DVD drive (it still spins up - even when not mounted): ENV{ID_SERIAL}=="PIONEER_DVD-RW_DVRTD11RS_SAC1009942", ENV{UDISKS_IGNORE}="1" KERNEL=="sr0",ENV{UDISKS_IGNORE}="1", RUN+="/bin/touch /home/peter/udev-rule-ran" The RUN+ in the second instance, creates my test file "udev-rule-ran", so this tells me that my rule file is being executed, and that the rule line is being run. My Question: Could you tell me what I should be doing to definitely disable the darned DVD drive? I also want to be able to enable the drive again on the occasions that I need it. Supplementary Details: I'm trying very hard to write a udev rule to disable my CD/DVD drive. I've tried various non-udev methods to disable it but none of them work. There is no loaded module¹⁾ for the drive that I can unload, so I can't use that method to disable the drive. ¹⁾ So I think the driver must be compiled into the kernel. | | Understanding network problem (syslog) Posted: 15 Jul 2022 01:01 PM PDT I am running a lubuntu 14.04 server and its always worked well, except for the last couple of days it keeps dropping off the LAN. I am using a couple of powerlink adapters to connect it up as WiFi was never very solid on it. Anyway, I plugged a screen and mouse/keyboard into it to try to work out whats up with it, and I tailed the syslog. Here is an excerpt: http://pastebin.com/4ftXsai4 Can someone please give me any clues to what might the problem be? Or any tips on how to track down the issue. I have unplugged the Ethernet cable from my router and rebooted it all, to no avail. EDIT #1 I'm not sure what happened. But the server has been up, connected all day today. I am tailing a log file via a remote SSH connection and its not disconnected once. Could have been that the WiFi card was playing up, or the router was struggling to assign DHCP, although, if it was a DHCP problem, why would it keep disconnecting? | | How to find which process is regularly writing to disk? Posted: 15 Jul 2022 03:05 PM PDT How can I find which process is constantly writing to disk? I like my workstation to be close to silent and I just build a new system (P8B75-M + Core i5 3450s -- the 's' because it has a lower max TDP) with quiet fans etc. and installed Debian Wheezy 64-bit on it. And something is getting on my nerve: I can hear some kind of pattern like if the hard disk was writing or seeking someting (tick...tick...tick...trrrrrr rinse and repeat every second or so). In the past I had a similar issue in the past (many, many years ago) and it turned out it was some CUPS log or something and I simply redirected that one (not important) logging to a (real) RAM disk. But here I'm not sure. I tried the following: ls -lR /var/log > /tmp/a.tmp && sleep 5 && ls -lR /var/log > /tmp/b.tmp && diff /tmp/?.tmp but nothing is changing there. Now the strange thing is that I also hear the pattern when the prompt asking me to enter my LVM decryption passphrase is showing. Could it be something in the kernel/system I just installed or do I have a faulty harddisk? hdparm -tT /dev/sda report a correct HD speed (130 GB/s non-cached, sata 6GB) and I've already installed and compiled from big sources (Emacs) without issue so I don't think the system is bad. (HD is a Seagate Barracude 500GB) | | Get file created/creation time? [duplicate] Posted: 15 Jul 2022 04:38 PM PDT | |
| Recent Questions - English Language & Usage Stack Exchange Posted: 15 Jul 2022 03:47 PM PDT | English equivalent of German da- constructions Posted: 15 Jul 2022 02:53 PM PDT In German, the prefix da- can precede a number of prepositions, and in each case the compound da preposition is an anaphor, with the meaning of the preposition itself + it. For instance, the preposition mit means 'with' in a variety of senses (accompaniment, instrument, amongst several others); the compound version of this preposition, damit, means 'with it/that'. So Wenn ich endlich damit fertig bin, kann ich draußen gehen means When I am finally done with it, I can go outside. Naturally, the interpretation of 'it' - i.e. what it refers to, its antecedent - should be available from the context. Now, you may well be familiar with the anticipatory 'it' in English. The anticipatory 'it' functions as a substitute for an extraposed subject. For instance, It is rude to speak like that. [To speak like that is rude.] It is such a pity that he is so clueless. [That he is so clueless is such a pity.] I fin etc. In these constructions, 'it' is said to anticipate the subject. I probably ought to note that 'it' can sometimes be used to anticipate an object, as in I find it amazing that no one has yet questioned the politician on this matter. In these cases, the extraposition is obligatory. In German, the compound da prepositions can likewise anticipate clauses. For instance, Ich freue mich darauf, dass wir nächstes Jahr nach Deutschland fahren werden means I am looking forward to going to Germany next year, but translates literally to I am looking forward to it, that we are going to Germany next year. Similarly, Es hängt davon ab, wie viel Geld wir verdienen können. means It depends on how much money we can earn (where 'it' here refers to whether or not they can go to Germany next year). Literally, however, it translates to It depends on it, how much money we can earn. In German, the need for anticipatory da constructions arises from the fact that a preposition cannot directly take a clausal complement. In English, this is not so: English prepositions can take as complement all types of clause but one, namely the content clause. In the case of the content clause, an alternative construction may be used: preposition + the fact + content clause. Here are some examples of this construction, as well as of clausal prepositional complements: I am looking forward to going to Germany next year. I agree with what she says. She is familiar with how the education system works. We need to get used to the fact that the entire world has changed etc. Although this overview of German da prepositions is by no means comprehensive, it is sufficient for the purpose of this question. For more information, I refer you to the following: Libre Texts - Da- Compounds University of Michigan - Germanic Languages and Literatures Learn German with Herr Antrim Now, without further ado, on to my question. In English, there exists a similar class of words to the German da prepositions: namely, the there compound prepositions. Amongst these are the following: thereby, therewith, thereto, therefor, thereupon, therein, thereafter, therein, thereat, thereto, therefrom Many of these compound prepositions are now archaic, or used exclusively in legal writing (or by quaint linguistic antiquarians). However, I am curious to know whether or not there were constructions in archaic English that employed the there compound prepositions in a similar way to the German da anticipatory constructions. In other words, did archaic English have anticipatory there constructions? Would sentences such as His argument relies thereon(,) that all the accused are guilty. and I am looking forward thereto(,) that we are going to Germany next year. have been grammatical, or indeed commonly uttered? (Naturally, the wording of the above sentences would have been different in archaic English, but I hope I have conveyed the thrust of my question.) | | What does this sentence imply? Posted: 15 Jul 2022 02:14 PM PDT We have met a long time ago before I was rich, but not before I was handsome. Does it mean they met a time when the person wasn't rich and handsome ? The last part 'but not before I was handsome' is confusing to me. | | Are, or how are, polyuria and diuresis different? [migrated] Posted: 15 Jul 2022 01:54 PM PDT Most websites appear to state that they are identical, or provide unhelpfully similar automatically generated description of each. | | What word means 'one of your responsibilities'? Posted: 15 Jul 2022 01:12 PM PDT What word means 'one of your responsibilities'? I'm looking for a word that means roughly 'an item in the job profile'. However I'm speaking in the context of an organisation's responsibilities, rather than that of an individual. | | Is that adv. + noun. right in grammar? [migrated] Posted: 15 Jul 2022 09:35 AM PDT | | What is the nearest British English equivalent to 'Dumpster Fire'? Posted: 15 Jul 2022 12:46 PM PDT Dumpster Fire is an informal term in the US for a chaotic or disastrously mishandled situation. I like it because of the way the term amplifies the meaning: the dumpster is not only full of undesirable cargo, but it is also mobile and on fire! What is the nearest equivalent to this pleasing term in British English? I am looking for a term with significant recognised usage and similar comedic and meaning-amplifying properties. | | Is there a better way to say "among other things" or "inter alia" in legalese? Posted: 15 Jul 2022 09:37 AM PDT I'm a Polish-English translator and I work mainly with legal documents. There's a phrase in Polish: "między innymi" (abbreviated as m.in) that means quite literally "among others". It's used everywhere in legalese; mostly in numbered lists: The program dedicated to the employees, pursuant to which, i.a.: (i) an Employee, at his/her request, may be assigned to work for another company in the Group for a period of 3 to 6 months; (ii) the Employee performs work during the assignment period under the supervision of the host company, but still under the Employment Contract. "Między innymi" can be used in both formal and informal texts. Now, here's what I think (correct me if I'm wrong): "among other things" sounds informal to me (because of the "things"). "Among others" usually refers to people. Neither of them can be abbreviated (?). Inter alia, or i.a. (is the punctuation/space correct? Also, is this abbreviation common and understandable to non-lawyers?) are both great, sure. However, I'd like to have more than this one option, especially when the document is intended for clients who don't always understand legalese. I've thought about "including" and its variations ("including without limitation"/ "including but not limited to") don't work with all sentence structures. Are there any more options for me to use? | | Borrowing & Corrupting a concept [closed] Posted: 15 Jul 2022 06:28 AM PDT I'm looking for a word or expression that means to take a concept from one area, corrupt it and use it in another sphere. Any ideas? | | Are both of the phrases express same sense? [closed] Posted: 15 Jul 2022 06:07 AM PDT Escape hatch=A hatch to escape. Chess board=A board to play chess on. Tin opener=Opener used to open a teen. Football Ground =Ground to play football in. | | What is the difference between "as tall as" and "just as tall as"? Posted: 15 Jul 2022 02:45 PM PDT What is the difference between I'm as tall as my father and I'm just as tall as my father? I know they are similar, But they make sense to be a little bit different. What is that difference? | | Phrases for transportation modes Posted: 15 Jul 2022 02:14 PM PDT I am writing a paper about car drivers, cyclists, and pedestrians. And I would like to use transportation modes in my text as well. However, I am confused about some phrases: - Is "Walk" or "Walking" the right word for a transportation mode? For example:
In this paper, we consider the modes motorized vehicles, bike and walk. - Which one is right:
The results of the modes motorized vehicles and bike or motorized vehicles and bike modes...? I would assume the same rule when I am writing about several modes or just one mode, right? Because it sometimes sounds wrong to my ears! | | Is the sentence "Most Hungarians have a good English accent" grammatically correct? Posted: 15 Jul 2022 08:43 AM PDT By constructing the sentence Most Hungarians have a good English accent I'm trying to say that most Hungarians can speak English well, without a strong accent. Now I understand that 'Most Hungarians' is a plural subject, so should the 'good English accent' agree with the plural subject? However, I'm not trying to say that each of them has their own distinct 'good English accents', I'm trying to say that they have a single English accent that is perceived as good by the general public. That is why I'm inclined to say 'a good English accent'. Which one is grammatically correct? Most Hungarians have a good English accent or Most Hungarians have good English accents Another example that is still along the lines of the main question and also keeps me up at night is when I'm trying to say Those three movies are a masterpiece. I'm referring to the three movies as three separate movies, but I want to say that in general, they are a masterpiece. Or should I say, 'masterpieces'? Am I wrong and just forcing a concept from my first language that just simply doesn't exist in English? | | What do I need to use adjective 'active selected' or adverb 'actively selected'? Posted: 15 Jul 2022 03:32 AM PDT In my commit message, I wrote something like: -disabled search button if there is no active selected filter and I got the following warning from my Integrated Development Environment (IDE) A. Make sure that the adjective 'active' is correct. Possibly, it should be an adverb (typically ~Iy) that modifies 'selected'. Possibly, it should be the first word in 2 compound adjective (hyphenated adjective). Possibly, it is correct.  Could you please clarify the situation how to write it correctly? thanks in advance | | What is a word for "to create a universe"? Can 'universalize' be used? Posted: 15 Jul 2022 08:25 AM PDT Per Lexico, universalize means: Give a universal character or application to (something, especially something abstract) 'theories that universalize experience' Can this definition include the sense "to create a universe" within a context? Per Wiktionary, universal also means: Of or pertaining to the universe. In many other credible dictionaries, universalize refers to a more succinct definition: "to generalize, to make available universally". For example: to make universal : Generalize - Merriam-Webster When I did a Google search for dictionary "to create a universe", no word with this meaning came up. What would be a suitable word/verb for 'to create a universe'? Possible example sentence: And he created a universe, gazed on the vastness and magnificence around him, and said 'I _______' (created a universe). | | Unsymmetric Double Emdash Posted: 15 Jul 2022 01:57 PM PDT In most cases, the emdash is used symmetrically to add Parenthetical Details. Example: It turned out that the three sisters ( Alexa, Siri, and Cortana ) were actually robots. It turned out that the three sisters — Alexa, Siri, and Cortana — were actually robots. It can also be used unsymmetrically to add Details at the end of a sentence. Example: The winner was the last : Cortana. The winner was the last — Cortana. Now, confusion arises when these two uses get mixed up in the same sentence. I've joked many times — it may not be a great business model to give things away and hope people will voluntarily support them — but this is how I've built my career so far! SOURCE: https://tech.slashdot.org/story/22/07/09/0129230/jimmy-wales-solicits-donations-for-his-ad-free-social-network Problem : It looks like the Symmetric use, but it is actually the Double use of the Unsymmetric use ! It can be interpreted in both ways ! Symmetrical Interpretation: I've joked many times [that] "It may not be a great business model to give things away and hope people will voluntarily support them" but this is how I've built my career so far! Unsymmetrical Interpretation: I've joked many times — "It may not be a great business model to give things away and hope people will voluntarily support them — but this is how I've built my career so far!" Questions: (1) Is my thinking correct or valid ? (2) In general, is there a way to remove the ambiguity without using more Punctuation like Parenthesis or Quotes ? Eg: By varying the size of the Dashes or the Spacing ? In a nutshell, can we indicate that Double emdashes in sentence are either indeed Symmetrical or indeed unsymmetrical ? Or is it inherently ambiguous ? | | When is "more than one" singular or plural? Posted: 15 Jul 2022 03:13 AM PDT I always learnt that "more than one" takes a singular verb because it is followed by a singular noun as in: more than one child has bad grades. But what happens when it is followed by a plural noun? For example: more than one of the children [has/have] bad grades? Grammarphobia says when "more than one" modifies a singular noun, it goes with a singular verb: "More than one person is going." But when it's followed by "of" and a plural noun, it takes a plural verb: "More than one of the people are going". -->https://www.grammarphobia.com/blog/2007/12/can-more-than-one-be-singular.html on the other hand, this site suggests a different answer: more than one of the authors has received the Nobel Prize. "More than one," although plural in meaning, always takes a singular verb. Another such idiom occurs when "one or two" acts as the subject: One or two was found in the kitchen. (However, "one or two were found in the kitchen" is also acceptable). -->https://crosstalk.cell.com/blog/10-tricky-cases-of-subject-verb-agreement And what happens when the sentence is preceeded by "there is/are" or "here is/are? So in the end what verb should I use? How can I correctly write these sentences: More than one of the dolphins contracts/contract dangerous diseases. More than one of them contracts/contract dangerous diseases. There is/are more than one sick dolphin. There is/are more than one of the sick dolphins. There is/are more than one of them. Normally I'd use the singular for all of the sentences above, but grammar sites made me lose my sense of grammar, of which I had little to no knowledge! Please help me. | | What accent can I put on "u" to make it sound like "you"? [closed] Posted: 15 Jul 2022 02:36 PM PDT I have a made up name, "Bunar," and I want the u to sound like you, rather than oo. Is there an accent I can put above u to tell readers to pronounce it this way? edit: feel free to explain how this is opinion based in any way | | What is the original semantic difference between "projectile" and "missile"? Posted: 15 Jul 2022 09:02 AM PDT Let consider context (e.g. historical recent past) where modern meaning of missile as a self-propelled ordinance with reactive or jet engine doesn't exist. Then its original meaning is "an object which is forcibly propelled at a target, either by hand or from a mechanical weapon" (Oxford). How it is different historically it was from projectile (if it was), which same source defines as "a missile designed to be fired from a gun" or "an object propelled through the air, especially one thrown as a weapon". Were they full synonyms, were they used interchangeably or projectile had appeared later? | | What is the origin of the joke 'a freckle past a hair' when one is asked the time of day? Posted: 15 Jul 2022 01:33 PM PDT Growing up in Canada, I heard this dialogue a hundred times:\ Dude: "What time is it?" Guy pantomimes watch-checking, but his wrist is bare Guy: "It's a freckle past a hair." Wiktionary even has a scant entry, except with the nouns flipped: https://en.wiktionary.org/wiki/a_hair_past_a_freckle I've even noticed this joke fading; perhaps it is because of smartphones. Is there a 'ground zero' for this phrase? | | Word or phrase which means purposely playing below your skill level? Posted: 15 Jul 2022 04:11 AM PDT I am looking for an idiom or expression which can be used to describe the action of someone deliberately playing below their skill level. For example, a pool or billiards expert missing a few shots on purpose. There are 2 situations where I am looking to use this expression, so, for any potential answer, I would like to know if it fits one or both of those meanings: 1. Negative Connotation The player is playing below his/her skill level because they are trying to deceive (for example, getting their opponent to feel overconfident and bet money on the next game). Example usage: He's ______-ing! He wants you to believe that he's less skilled than he actually is. 2. Positive Connotation The player is playing below his/her skill level because they want their opponent to have fun and not feel bad about losing by a heavy margin. Example usage: My father-in-law wanted to play chess so I had to __________ because winning in a few moves might have been a bit humiliating. What I considered The expression "to dumb down" came to mind initially but it means something different. The verb "to hustle". Dictionary definitions seem to imply that it would work only for the case with the negative connotation, but I am not entirely sure. Cambridge Dictionary suggests several meanings of the word, but the most relevant one is: a dishonest way of making money However, I believe that in colloquial usage the word tends to have a neutral or even positive meaning: hustlin' The problem I have with this word is that it seems to be connected to money, but I would like something more general and not specific to making money. To go easy: This seems to fit the case with the positive connotation, for example, "I decided to go easy." So this is one I'm heavily considering. To smurf: This slang word fits well but it's only used in online gaming as far as I know. | | Synonym for to-be-discovered? Posted: 15 Jul 2022 01:43 PM PDT What is an academic synonym for "to-be-discovered" in "The issue can be examined through a variety of discovered and to-be-discovered methods"? The point for using to-be-discovered here is that I wish to emphasize that in future there may methods that can examine better the issue even if current methods can not do so fully. So, the issue still deserves discussion. | | Continue or continues? Posted: 15 Jul 2022 02:47 PM PDT For an epitaph, would you write: Her joy and love of life continue to inspire us all or Her joy and love of life continues to inspire us all TIA | | What do you call the gesture whereby you rest your palms on the side of your hips? Posted: 15 Jul 2022 06:46 AM PDT What do you call the gesture whereby you rest your palms, the front of your fist, or your wrist on the side of your hips? Kind of like these examples:  Update: Guess I should've made it clear: I did Google "hands on hips gesture". I didn't get a concrete source to back it up, so I went ask here. | | Etymology of the word "slave" Posted: 15 Jul 2022 05:35 AM PDT Webster says that the word "slave" goes back to the word "Slav", as the early slaves in Europe were all from among Slavs. Is this etymology generally accepted, or are there some other theories? | | To sightsee ...or ..to go sightseeing? Posted: 15 Jul 2022 06:47 AM PDT How common is it, nowadays, to say that one 'sightsees', rather than 'goes sightseeing'? | | Where does the word “jism” come from? Posted: 15 Jul 2022 03:19 AM PDT Another word of mysterious origins of jism, in the sense of spunk. The OED mentions it is sometimes spelled jizz, and may even be the precursor word to jazz. But neither the OED nor Etymonline gives any etymology for this word. The oldest citation is from 1847, and there are many citations from the 20th century. So where do we get the word jism from? | | Capitalize after slash at beginning (e.g. Risk/Issue management) Posted: 15 Jul 2022 07:24 AM PDT Should a word after a slash at the beginning of a sentence be capitalized? E.g. - Risk/Issue management
- Risk/issue management
I would guess the first one is correct because "Issue" would be an alternative beginning due to the slash. | |
| OSCHINA 社区最新专区文章 Posted: 15 Jul 2022 11:27 AM PDT | GCC Rust 得到 GCC 批准,将被纳入主线代码库 Posted: 09 Dec 2017 04:35 PM PST 该编译器将获得对所有 GCC 内部中端优化通道的完全访问权,这与 LLVM 不同。 | | 云计算和开源时代,数据库团队的地位上升了还是下降了? Posted: 14 Jul 2022 04:13 AM PDT 文章来源:微信公众号 "信息化与数字化" 作者:沈旸 作为企业的科技战略决策者,如何看待数据库在企业数字化转型策略中的定位? 最近十几年,数据库领域发生了非常大的变化,尤其是有了云计算和分布式数据库以后。在2012年之前,市场上流行的大多数是商业数据库,例如Oracle,Microsoft SQL Server,IBM DB2,这三大数... | | 与我们一起,为中国开源人写本“传记”丨《中国开源发展研究报告2022》问卷调研启动 Posted: 13 Jul 2022 12:23 AM PDT 今天你用 GitHub / Gitee 了吗? 你关注的开源技术领域是什么? 你在参与开源过程中遇到过什么问题? 你是否想对开源项目的维护者们提出自己的意见? 从去年国内开源理念的深入人心,到今年上半年开源圈的捷报频传,我们正在全面踏入"开源创新"的时代。开源之声,此起彼伏,对于开发者而言,参与开源有什么价值?如何参... | |
| OSCHINA 社区最新专区文章 Posted: 15 Jul 2022 07:43 AM PDT | 微软推出 VS Code Server,用平板也能远程开发! Posted: 09 Dec 2017 04:35 PM PST 在不支持安装 VS Code 桌面版的机器上进行开发,最多只能有 10 台远程机器运行同一 VS Code Server。 | | 2021 年度 OSC 中国开源项目评选投票开始 Posted: 05 Dec 2021 04:13 PM PST 由开源中国举办的国内最权威、最盛大的开源项目评选活动,旨在更好地展示国内开源现状,探讨国内开源趋势,激励国内开源人才,促进国内开源生态完善。 | | Next.js 开发商收购 Turborepo,以加快构建速度 Posted: 09 Dec 2021 04:40 PM PST Vercel 是知名开发框架 Next.js 背后的开发商,在上个月他们完成了 D 轮 1.5 亿美金的融资,使得总融资金额达到 3.13 亿美元,估值达到了 25 亿美金。 财力雄厚的他们今天对外宣布,他们已经收购了 Turborepo。Turborepo 是一个用于 JavaScript 和 TypeScript monorepos 的高性能构建系统,可以将构建速度提高 85%。mon... | |
| V2EX - 技术 Posted: 15 Jul 2022 07:22 AM PDT | 一个编程小白关于微信读书的程序构想 Posted: 13 Jul 2022 11:50 AM PDT 学了一周的 Python ,刚刚学到了一点皮毛,目前的水平仅能徒手写出来个人机对战的剪刀石头布的小游戏。 不过远景目标也是有的,就是想写一个以生成时间为过滤条件的微信读书笔记导出工具,目前市面上还看没看到能实现类似功能的程序。 要实现这个目标大概需要以下几个步骤: -
通过微信读书 API 抓取读书笔记到本地数据库。 -
通过判断笔记 /高亮划线生成的时间戳,过滤出自『上次导入时间』-『当前时间』这一时间段的所有笔记 /高亮划线内容。 -
将过滤出的所有笔记逐条打上『#YYYY-MM-DD 』格式的日期 tag 和『#书名』 tag ,外加 1-2 个自定义 tag ,例如『#inbox 』。 -
将输出的笔记写入到一个名为 WR_YYYYMMDDmmss(本次导入时间).md 的文件中,并自动将这个文件存入 Logseq 的 pages 文件夹下面。 它的目标用户群应该主要是,以微信读书为主要阅读器,喜欢同时阅读多本书,有回顾 /深度处理读书笔记的刚需,并且主力使用 Logseq/Roam/Obsidian 等双链笔记工具进行个人知识管理的人群。 名字我也起好了,就叫『微信读书时间胶囊』。 | |
| OSCHINA 社区最新专区文章 Posted: 14 Jul 2022 07:00 PM PDT | 基于 Rainbond 部署 DolphinScheduler 高可用集群 Posted: 13 Jul 2022 08:21 PM PDT 本文描述通过 [Rainbond](https://www.rainbond.com/) 云原生应用管理平台 一键部署高可用的 DolphinScheduler 集群,这种方式适合给不太了解 Kubernetes、容器化等复杂技术的用户使用,降低了在 Kubernetes 中部署 DolphinScheduler 的门槛。 Apache DolphinScheduler 是一个分布式易扩展的可视化 DAG 工作流任务调度开... | |
| OSCHINA 社区最新专区文章 Posted: 14 Jul 2022 03:25 PM PDT | 【超详细】手把手教你搭建MongoDB集群 Posted: 13 Jul 2022 11:59 PM PDT  ## MongoDB集群搭建 ### MongoDB集群简介 > mongodb 集群搭建的方式有三种: 1. 主从备份(Master - Slave)模式,或者叫主从复制模式。 2. 副本集(Replica Set)模式 3. 分片(Sharding)模式 > 其中,第一种方式基本没什么意... | | 分布式数据库跨版本升级数据迁移方案 Posted: 13 Jul 2022 08:08 PM PDT 动机 向后兼容性对数据库至关重要,但会给代码库带来相当大的复杂性。 在其他条件相同的情况下,最好将向后兼容性逻辑与分布式数据库软件系统所固有的复杂性隔离开来,尤其是诸如元数据等各种系统数据,需要一个整体的升级迁移方案来统一处理。 短期设计 1. 因为在一般情况下处理升级迁移是一个非常广泛的问题,包括许多... | |
| Recent Questions - Stack Overflow Posted: 14 Jul 2022 03:11 PM PDT | Apexchart angular: Mounted event called twice Posted: 14 Jul 2022 02:51 AM PDT I currently have an ApexChart in my Angular application: <apx-chart *ngIf="chartOptions" #chart [yaxis]="chartOptions.yaxis" [xaxis]="chartOptions.xaxis" [series]="chartOptions.series" [chart]="chartOptions.chart" [stroke]="chartOptions.stroke" [markers]="chartOptions.markers" [plotOptions]="chartOptions.plotOptions" [legend]="chartOptions.legend" [fill]="chartOptions.fill" [responsive]="chartOptions.responsive" [tooltip]="chartOptions.tooltip" ></apx-chart> With the following JS: this.chartOptions = { ... chart: { events: { mounted: (chartContext, config) => { this.chartMounted(chartContext, config); } } } ... } Works fine but the 'mounted' event is always called twice. I tried using only one series to check if it mounted per series, but then also it was called twice. Any idea why this happens? | | Get only message or description in the notification using flask abort? Posted: 14 Jul 2022 02:51 AM PDT I want to get the error message on the screen, I tried all these variations abort(make_response(jsonify(message="Error message"), 400)) abort(400, description ="invalid inputs") The problem is it's showing {"code": 400, "name": "Bad Request", "description": "Invalid inputs; gewea.tcy: File format not supported"} in the notification box. I don't want any of that, I just want the message or description and I am flabbergasted of not being able to find solution. Help! | | POSTGRESQL FILE OR IMAGE UPLOAD USING JDBC DRIVER Posted: 14 Jul 2022 02:51 AM PDT I have to insert file or images into the postgresql database. i have designed table with jsonb column data type. Previously i have used bytea as column data type and used jdbc driver method setBinary to set data in prepared statement. Now i have to use jsonb and what is jdbc driver method i have to use to insert my file or jsonb is not supported for files. | | Arm azure table - entity/ item Posted: 14 Jul 2022 02:51 AM PDT I just deployed through arm template new storage and table I wonder how can I deploy it with adding entities also if I could populate some of the rows in arm also someone can help me please ? | | How to check programmatically that user has enable the AutoStart permission or not ? (in MI devices) Posted: 14 Jul 2022 02:51 AM PDT I am able to to go setting & comeback from it but didn't get if user has enable the AutoStart or not. | | Read data from pyodbc to dask Posted: 14 Jul 2022 02:51 AM PDT At the moment connecting from pyodbc and reading the data to a pandas data frame. However, I want to change the codebase to use desk instead of pandas. Is there a simple way to use dask without changing much of this code? cnxn = pyodbc.connect( 'DRIVER={ODBC Driver 18 for SQL Server}; \ SERVER='+ os.environ['server'] +'; \ DATABASE='+ os.environ['database'] +';\ uid='+ os.environ['uid'] +';\ pwd='+ os.environ['pwd'] +';\ Trusted_Connection=no;') #get last 10 days of data datetime_limit = str(datetime.today() - timedelta(days=10))[:-3] #use env var for table to protect from sql injection sql = f"SELECT * from {os.environ['dbtable']} WHERE {os.environ['limiter']} > '{datetime_limit}' " data = pd.read_sql(sql,cnxn) | | How to fix the error when working with recursion and array? Posted: 14 Jul 2022 02:50 AM PDT I'm trying to solve a problem - need to return an array after entering a value to search. The depth of an array can be theoretically infinite. So I'm recursing to find suitable elements among any depth level and add them to the array and then return this array. But this code does not work as expected. I can't figure out what exactly I did wrong here. Also link to codeSandbox - https://codesandbox.io/s/pensive-montalcini-ms1jir?file=/src/index.js:0-1177 const newList = [ { role: "role111", title: "title1", }, { role: "role222", title: "title2", }, { role: "role333", title: "title3", }, { role: "role444", title: "title4", items: [{ role: "role555", title: "title5", }, { role: "role666", title: "title6", }, { role: "role777", title: "title7", items: [{ role: "role888", title: "title888", },{ role: "role8888", title: "title8888", },] },] }, { role: "role999", title: "title999", }, ]; const text = "role888"; const testFunction = ( list, text, emptyArray ) => { let arrayForRender = emptyArray; return list?.filter((item) => { if (item.title.toLowerCase().includes(text.toLowerCase())) { arrayForRender = [...arrayForRender, item]; return arrayForRender; } if (item.items && item.items?.length > 0) { testFunction(item.items, text, arrayForRender); } }); }; console.log(testFunction(newList, text, [])); | | Does SignInAsync have the ability to create jwt like how it does for cookies? And whether to avoid using SignInAsycn when using JWT auth? Posted: 14 Jul 2022 02:50 AM PDT I have a project with .NET Identity tables and SignIn and User manager. The SignInManager.PasswordSignInAsync checks whether the username and password is correct and if so then it will create the cookie as part of the response. Currently the authentication configured is the default cookie based. Following is the existing example of login action: [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) { if (!ModelState.IsValid) { return View(model); } // Require the user to have a confirmed email before they can log on. var user = await UserManager.FindByNameAsync(model.Email); // This doesn't count login failures towards account lockout // To enable password failures to trigger account lockout, change to shouldLockout: true var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false); switch (result) { case SignInStatus.Success: return RedirectToLocal(returnUrl); case SignInStatus.Failure: default: ModelState.AddModelError("", "Invalid login attempt."); return View(model); } } I want to change this to JWT based and for this I plan to create the following: - GetUserFromDb(username, password) - this will be called instead of
SignInManager.PasswordSignInAsync and it will check in the db if the user exists and return the user details - CreateJWT(userdetails) - the output of point 1 will be passed into this method as an argument and this method will build the JWT token with user name, and all the claims.
- Change the authentication scheme in startup to JWT bearer based
Instead of doing any of the above manual work, I want to ask- - Suppose I change the authentication scheme to JWT bearer based, then does
SignInManager.PasswordSignInAsync have the ability to return a JWT rather than the cookie? - During User registration, I can continue using
var result = await UserManager.CreateAsync(user, model.Password);. But during login does it make sense to use SignInManager.PasswordSignInAsync (to check user/password) and then call the GetUserFromDb (to return user info) followed by CreateJWT (to set JWT)? Or should I prefer to not use the SignInManager.PasswordSignInAsync? - Does
SignInManager.PasswordSignInAsync create cookie in the response only if the authentication scheme is default (cookie based) or does it do so even if the Authentication scheme is changed to JWT bearer based? In this case it doesn't make sense to use SignInManager.PasswordSignInAsync when doing a JWT based authentication? | | Query the Euclidean Distance between points and and format your answer to display decimal digits Posted: 14 Jul 2022 02:51 AM PDT select round((sqrt((pow((max(lat_n)-min(lat_n)),2))+(pow((max(long_w)-min(long_w)),2)))),4) from station; Link to the question HackerRank | | Backtesting a trading strategy of buy and sell using backtesting package Posted: 14 Jul 2022 02:51 AM PDT I tried to backtest a strategy of buying and selling a stock using package backtesting but i obtain the same result for all (i,j). The code is bellow from backtesting import Backtest, Strategy from fastquant import get_stock_data vix=get_stock_data("^VIX","2007-06-01","2010-01-01") vix=vix.reset_index() vix=vix.rename(columns={'dt':'','open':'Open','high':'High','low':'Low','close':'Close','volume':'Volume'}) vix=vix.set_index('') class vixstrategy(Strategy): def init(self): price = self.data.Close def next(self): self.buy_int=i self.sell_int=j self.buy() self.sell() table=[] for i in range(10,30,5): for j in range(30,50,5): bt = Backtest(vix, vixstrategy,exclusive_orders=True) resultat = bt.run() print(resultat) table.append(resultat[["Equity Final [$]","Return [%]","Sharpe Ratio","Max. Drawdown [%]","# Trades","Avg. Trade Duration","Duration","Max. Trade Duration"]]) bt.plot() df = pandas.DataFrame(table) print(df) Could you give me some suggestions | | Change names of columns which contain only positive values Posted: 14 Jul 2022 02:50 AM PDT Let's consider data frame following: import pandas as pd df = pd.DataFrame([[1, -2, 3, -5, 4 ,2 ,7 ,-8 ,2], [2, -4, 6, 7, -8, 9, 5, 3, 2], [2, 4, 6, 7, 8, 9, 5, 3, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9]]).transpose() df.columns = ["A", "B", "C", "D"] A B C D 0 1 2 2 1 1 -2 -4 4 2 2 3 6 6 3 3 -5 7 7 4 4 4 -8 8 5 5 2 9 9 6 6 7 5 5 7 7 -8 3 3 8 8 2 2 2 9 I want to add at the end of the column name "pos" if column contain only positive values. What I would do with it is: pos_idx = df.loc[:, (df>0).all()].columns df[pos_idx].columns = df[pos_idx].columns + "pos" However it seems not to work - it returns no error, however it does not change column names. Moreover, what is very interesting, is that code: df.columns = df.columns + "anything" actually add to column names word "anything". Could you please explain to me why it happens (works in general case, but it does not work on index case), and how to do this correctly? | | Why Where clause in not working with Virtual property in LINQ Posted: 14 Jul 2022 02:50 AM PDT I am trying to do something like this var users = await _dbContext.Users.AsNoTracking().AsQueryable() .Include(user => user.AdminRoles) .Where(u => u.AdminRoles.Roles.Contains("admin2022")) .ToListAsync(); Here the list is getting 0 results, but when I do var users = (await _dbContext.Users.AsNoTracking().AsQueryable() .Include(user => user.AdminRoles).ToListAsync()) .Where(u => u.AdminRoles.Roles.Contains("admin2022")) .ToList(); Then it yields all the required results. Could some one please help me how can I make the first way work ? | | Parse string of key value pairs where key occurs multiple times into object Posted: 14 Jul 2022 02:50 AM PDT I have a string in the following format: "foo: bar, foo: baz, some: thing, some: other, third: other" And what i want is an object: { foo: [bar, baz], some: [other, thing], third: [other] } How could I achieve this in a smart way? | | Launch ZAP using a script if not already running Posted: 14 Jul 2022 02:51 AM PDT I launch ZAP with a python script using subprocess: filePath=r"C:\\Program Files\\OWASP\\Zed Attack Proxy\\zap-2.11.1.jar" subprocess.Popen(filePath, shell=True, stdout=subprocess.PIPE) This script works fine and launches ZAP. However, I'd like to have a check whether the app is already running and if so, not to launch it again. I took a look how could this be achieved in python and realized I could use a check for running processes. Problem is that the process runs as Java(TM) Platform SE binary in Task Manager so checking for that one might not be the best solution. Any idea how to solve this would be appreciated. Aiming for python/ps script. Thank you! | | TCN model result seems like offset by one time step Posted: 14 Jul 2022 02:51 AM PDT I have been training a temperature dataset with TCN model. I Have tested it on small data available. I am training a bivariate TCN model with the data which I am giving input is Maximum temperature and minimum temperature to predict maximum temperature. I want to know if this is overfitting or if the graph is right Graph here Below is my model i = Input(shape=(lookback_window, 2)) m = TCN(nb_filters = 64,dropout_rate=0.1,activation='relu',padding='causal')(i) m = Dense(3, activation='linear')(m) model = Model(inputs=[i], outputs=[m]) model.summary() The summary of the model is given here | | Net Framework - WaitForExit not working because I can't determine svchost.exe PID Posted: 14 Jul 2022 02:51 AM PDT I need to show the Windows Task Scheduler window and wait until the user closes it before continuing the main program. I've tried with this method: public static bool RunCommand (string command) { try { ProcessStartInfo startInfo = new ProcessStartInfo { FileName = "cmd.exe", Verb = "runas", Arguments = "/C " + command, UseShellExecute = false }; Process process = new(); process.StartInfo = startInfo; process.Start(); process.WaitForExit(); return true; } catch (Exception) { return false; throw; } } I've tried passing the following commands as the argument "command" in order to show up the Task Scheduler: - "taskschd.msc"
- "start /wait taskschd.msc /s"
- "C:\windows\system32\taskschd.msc /s"
- "control schedtasks"
The idea is to continue the execution of the main program when the Task Scheduler is closed (its process is killed), but the "process.WaitForExit();" instruction is linked to the cmd command, so the main program continues after cmd process is closed, even when the Task Scheduler window is still being displayed. The problem is that the "taskschd.msc" process, when launched, is wrapped into an "svchost.exe" process. I can't determine its PID because of the many different svchosts running at the same time, so I can't kill it manually either. I've tried the solutions proposed here, but to no avail. I've also been looking for a way to give an alias to the the "scvhost.exe" process launched with this cmd, but it seems that's not possible. I've been thinking of compiling a new exe just to launch the Task Scheduler under a process name that I could control, but I don't think it is a good solution. Any ideas, please? Thank you very much. | | google submit sheet check for duplicate Posted: 14 Jul 2022 02:51 AM PDT Anyone can advise that how could I check data from my submission form and doesn't allow proceed if there is a duplicate data from my database sheet and if no duplicate and proceed for data entry. here my gs code // SUBMIT FORM DEPOSIT function submit() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var formS = ss.getSheetByName("Form"); //form entry sheet var extdata = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1BDKOHu0H7OddXeCIDYn1o6EwLd123fYgQFmRHC-SR5C1Zs/edit#gid=0") var dataS = extdata.getSheetByName("Database");//form sheet var duplicate = formS.getRange("B9").getValue(); var values = dataS.getDataRange().getValues(); for (var i = 0; i < values.length; i++) { var row = values[i]; if (row[0] == duplicate) { SpreadsheetApp.getUi().alert('Duplicate data. Please Check Your Input Data'); } else { var values = [[formS.getRange("B9").getValue(), formS.getRange("B7").getValue(), formS.getRange("B11").getValue(), formS.getRange("B13").getValue(), formS.getRange("B15").getValue(), formS.getRange("B19").getValue(), formS.getRange("B17").getValue(), formS.getRange("B5").getValue()]]; dataS.getRange(dataS.getLastRow() + 1, 1, 1, 8).setValues(values); clearcell(); } } } | | How to bind Query parameter into the datetime using room Posted: 14 Jul 2022 02:50 AM PDT I would like to bind a parameter into the datetime method of a sql query. You can see below what I tried. I have tried enum too, but it seems enums are parsed by the name of enum and I can't give -7 days as a value to enum The query i would like the code to produce looks like this. SELECT * FROM Part where Timestamp > datetime('now' ,'-7 days') Code#1 @Query("SELECT * FROM Part where Timestamp >datetime('now' ,'-'+:days+'days')") List<Part> getPastDays(int days); Produces query#1 (is incorrect as it does not fetch the data) SELECT * FROM Part where Timestamp >datetime('now' ,'-'+'7'+'days') Code#2(Does not compile->error: Unused parameter: days) @Query("SELECT * FROM Part where Timestamp >datetime('now' ,'- :days days')") List<Part> getPastDays(int days); Code#3 @Query("SELECT * FROM Part where Timestamp >datetime('now' ,'-' /:days/ 'days')") List<Part> getPastDays(int days); Produces Query#3( is incorrect as does not return data) SELECT * FROM Part where Timestamp >datetime('now' ,'-' /'7'/ 'days') | | Xamarin iOS only crash physical iPhone when you open an app Posted: 14 Jul 2022 02:50 AM PDT I'm facing a strange error. App only crashes on physical device. But iOS simulator does not. It working fine. The strange thing is it crashes when you open an app and FinishedLaunching(UIApplication app, NSDictionary options) method does not call at all. What possibilities might have this issue? | | how to get a particular field from django model Posted: 14 Jul 2022 02:51 AM PDT I want a command for getting a query set from the model. The SQL command will be like - SELECT teamName FROM TABLE WHERE userName=userName; | | PictureBox with SizeMode = Zoom and image size Posted: 14 Jul 2022 02:51 AM PDT I have Large image in PictureBox with SizeMode = Zoom. How can I get pixel coords from image when I click on PictureBox or how get image position and size in this case? Thanks all for any help. App window | | Graphql create object with fragment Posted: 14 Jul 2022 02:50 AM PDT I can query a graphql object like this info { firstname lastname phone email } I want to create an object contactInfo so I can query contactInfo and put phone and email inside that. info { firstname lastname ...contactInfo } fragment contactInfo on person { contactInfo: { phone email } } but this keeps giving me error, how can I use fragment to put phone and email inside contactInfo? | | CORS configuration not working in Drupal 9 [closed] Posted: 14 Jul 2022 02:50 AM PDT I have a website (static react) "example.com" and a admin website (drupal) "admin.example.com". In Drupal I enabled the rest api json module to fetch the data. Now at example.com I get an cors error. Understandable. I tried to fix this by editing services.yml and default.services.yml to the following, but still I get a 500 error from the server when requesting something. If I try to get something with Postman or just the browser, everything works fine. Access to fetch at 'https://admin.example.com/jsonapi/node/stage' from origin 'https://example.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, https://example.com', but only one is allowed. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. cors.config: enabled: true # Specify allowed headers, like 'x-allowed-header'. allowedHeaders: ['x-csrf-token', 'authorization', 'content-type', 'accept', 'origin', 'x-requested-with'] # Specify allowed request methods, specify ['*'] to allow all possible ones. allowedMethods: ['*'] # Configure requests allowed from specific origins. allowedOrigins: ['example.com', 'www.example.com', 'http://example.com', 'https://example.com', 'http://www.example.com', 'https://www.example.com', '*'] # Sets the Access-Control-Expose-Headers header. exposedHeaders: false # Sets the Access-Control-Max-Age header. maxAge: false # Sets the Access-Control-Allow-Credentials header. supportsCredentials: false | | How to take out unique key value pairs with it's other values as well Posted: 14 Jul 2022 02:50 AM PDT Help me in taking out unique fruit without reducing it's repeat count ? I've been trying to arrange this array in an order to take out the same fruit name objects to a seperate array. I am trying to get something like this : [{fruit:'apple',id:2},{fruit:'apple',id:6},{fruit:'apple',id:5},{fruit:'apple',id:6},{fruit:'apple',id:9},{fruit:'grape',id:3},{fruit:'grape',id:10},{fruit:'orange',id:4},{fruit:'orange',id:8},{fruit:'banana',id:7},{fruit:'banana',id:11}] From the array const arr= [{fruit:'apple',id:2},{fruit:'grape',id:3},{fruit:'orange',id:4},{fruit:'apple',id:5}, {fruit:'apple',id:6},{fruit:'banana',id:7},{fruit:'orange',id:8}, {fruit:'apple',id:9},{fruit:'grape',id:10},{fruit:'banana',id:11}] | | Android Emulator keep showing allow USB debugging prompt Posted: 14 Jul 2022 02:51 AM PDT I just installed Android Studio Bumblebee (2021.1.1 Patch 2) But when I try to run my emulator, I got allow USB debugging prompt that always showed up even after I press allow, check the always allow option, or even cancel it. I already tried to restart my adb server and remove and create a new emulator, wipe the data and try to cold boot it, but the issue persists. Does anyone know what is the root cause of this issue and how to solve it? I can still develop using real device but I do want to know if this issue able to be resolved.  Emulator: Google Pixel 3 API 30 | | PowerBi Service principals and Row level Security Posted: 14 Jul 2022 02:51 AM PDT We are using PowerBi and would like to embed a report in another system. We have set up everything so far and can display the reports with a service principal for several users. However, we only want the users to see their own records, so we have created roles that only display a few records based on the username. This works well in the PowerBi Desktop 'view as'. But when we request the embed token from the other system, we get a 400 response code back. I have read the following(https://docs.microsoft.com/en-us/power-bi/enterprise/service-admin-rls): Service principals cannot be added to an RLS role. Accordingly, RLS won't be applied for apps using a service principal as the final effective identity. Can I then achieve my goal at all, that a large group of users can view a report and only see their own data? Or is that only possible if I create a separate account for each user? My report without roles can be embedded. That works. Then I added a role to my report. Role is Owner and DAX is [Owner__c] = USERNAME()  And adjusted the body of the API from: { "accessLevel": "View", "datasetId": "8d72284e-f104-4213-9376-606397b2f838" } to { "accessLevel": "View", "allowSaveAs": "false", "identities": [{ "username": "0015p00005ZSE7wAAH", "reports": ["7fa1badb-ccb3-45b8-84cb-15e5b2018efa"], "roles": ["Owner"], "datasets": ["8d72284e-f104-4213-9376-606397b2f838"] }] } This is a my datatable  Did I miss a point? Do I need to add someone(who?) to this the role under dataset security? Why is USERPRINCIPALNAME() or USERNAME() not the id, which I defined in the request body? As soon as I add a role to my report(Dax:[Owner__c] = TRUE) or ([Owner__c] = USERNAME() or even hardcoded [Owner__c]='0015p00005ZSE7wAAH') I get a status code 400 | | How to modify request headers in Next.js Posted: 14 Jul 2022 02:51 AM PDT I have a need to add a header to each request to the server. I do it this using _midleware like this: export async function middleware(req: NextRequest): Promise<NextResponse> { req.headers.append('x-custom-header', '1337'); return NextResponse.next(); } If I do console.log(req.headers) I see that the request header has been added: BaseHeaders [Headers] { [Symbol(map)]: { accept: [ '*/*' ], 'accept-encoding': [ 'gzip, deflate, br' ], 'accept-language': [ 'en-GB,en-US;q=0.9,en;q=0.8' ], 'cache-control': [ 'no-cache' ], connection: [ 'keep-alive' ], cookie: ..., host: ..., pragma: [ 'no-cache' ], referer: ..., ..., 'x-custom-header': [ '1337' ] } } However, this does not modify the request: there is no request header in the browser. Why is the request not modified? Are there alternative ways to modify request headers in Next.js? | | How to use v-bind=$attrs in vue 3? Posted: 14 Jul 2022 02:51 AM PDT I am migrating vue 2 application to vue 3. In official docs, it is mentioned that $listeners object has been removed in Vue 3. Event listeners are now part of $attrs. It is taking non-prop attributes (class, style) as well. In my vue 2 application, there is one icon-button custom component and it is looking like this below. Icon-component: <template> <vu-button v-bind="buttonProps" :class="buttonClass" v-on="$listeners" @click="buttonToggle"> <vu-icon v-bind="iconProps"><slot/></vu-icon> </vu-button> </template> It is used in various other components. Parent component 1: <vu-icon-button id="sw1" medium style="left:200px;">home</vu-icon-button> Parent component 2: <vu-icon-button class="menu-detail-btn" icon="collapse_menu" icon-type="su" @click="openModal()" size="small"></vu-icon-button> As of migration strategy, i removed the $listeners but not sure about those non-prop attributes and v-bind tag. How to modify those so it can be used in parent component with attributes? | | std::string::append crashes program with "std::bad_alloc" Posted: 14 Jul 2022 02:50 AM PDT I have a text file which contains a list of data relating to name, position, and height. My program parses this data into a vector map, then uses this data to construct an xml file using boost::property_tree. The text file is about 3500 lines, and the program consistently crashes at line 1773 with: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped) At first I thought maybe the size limit was being reached, but reading up on std::string shows that the target computer should be able to allocate the size required. Regardless, I decided to test with std::string::size , std::string::length, std::string::capacity, std::string::max_size which showed (respectively): ... ... 6572094845 6572094845 6626476032 9223372036854775807 6579537815 6579537815 6626476032 9223372036854775807 6586984998 6586984998 6626476032 9223372036854775807 6594436394 6594436394 6626476032 9223372036854775807 6601892003 6601892003 6626476032 9223372036854775807 6609351825 6609351825 6626476032 9223372036854775807 6616815856 6616815856 6626476032 9223372036854775807 6624284100 6624284100 6626476032 9223372036854775807 std::string::capacity was seen to increase once std::string::length == std::string::capacity. gdb bt after compiling for debug: (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 #1 0x00007fd67037e921 in __GI_abort () at abort.c:79 #2 0x00007fd6709d3957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #3 0x00007fd6709d9ae6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #4 0x00007fd6709d9b21 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #5 0x00007fd6709d9d54 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #6 0x00007fd6709da2dc in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007fd670a6bb8b in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #8 0x00007fd670a6d133 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #9 0x000056104c176f3a in main (argc=1, argv=0x7ffc0af8b9a8) at /home/code/hello_world/createWorld.cpp:224 Example line in text file being read: 713.258 235.418 ABCD1234567 2898 Code: int main(int argc, char **argv) { CreateWorld *newWorld = new CreateWorld(); lastModelsParser *lastModels = new lastModelsParser(); /* Code here reads creates ifs for xml data, then reads xml successfully into a ptree */ vector<lastModelsParser::lastModel> _lastModels; _lastModels = lastModels->getlastModels(); uint16_t lastModelsEntry = 0; std::string newModelString; for(auto i:_lastModels){ ptNewModel = newWorld->modelModifier(ptModel, _lastModels.at(lastModelsEntry).pX, _lastModels.at(lastModelsEntry).pY, _lastModels.at(lastModelsEntry).name, _lastModels.at(lastModelsEntry).height); boost::property_tree::xml_parser::write_xml_element(modelOSS, ptNewModel.front().first, ptNewModel.back().second, 1, xml_settings); newModelString.append(modelOSS.str()); // CRASHES HERE lastModelsEntry++; } // append to world.xml boost::property_tree::write_xml(worldOSS, ptWorld, xml_settings); // write xml data into OSStreams boost::property_tree::write_xml(modelOSS, ptModel, xml_settings); // write xml data into OSStreams size_t worldPos = worldOSS.str().find("</world>"); std::string newWorldString = worldOSS.str().insert(worldPos,newModelString+"\n\t"); newWorldFile << newWorldString ; delete(lastModels); delete(newWorld); return EXIT_SUCCESS; } Edit. Valgrind output valgrind --tool=massif --massif-out-file=memleak.txt ./createNewWorld heap_tree=detailed n2: 6636657886 (heap allocation functions) malloc/new/new[], --alloc-fns, etc. n2: 6626476282 0x5160B89: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25) n2: 6626476282 0x5162131: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25) n0: 6626476033 0x149F38: main (in /home/code/hello_world/createNewWorld) n0: 249 in 2 places, all below massif's threshold (1.00%) n0: 0 in 2 places, all below massif's threshold (1.00%) n0: 10181604 in 18 places, all below massif's threshold (1.00%) valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out_1.txt ./createNewWorld ... --4758-- memcheck GC: 1000 nodes, 0 survivors (0.0%) --4758-- memcheck GC: 1000 nodes, 0 survivors (0.0%) --4758-- memcheck GC: 1000 nodes, 0 survivors (0.0%) --4758-- memcheck GC: 1000 nodes, 0 survivors (0.0%) ==4758== Warning: set address range perms: large range [0xee015040, 0x1b37d5041) (undefined) | | How do I change the color for ng2-charts? Posted: 14 Jul 2022 02:50 AM PDT I have added ng2-charts to my project and display 2 charts - donut & barchart. both are displayed in gray since I added <base-chart class="chart" [colors]="chartColors" ... </base-chart> to the component.template.html, and public chartColors:Array<any> =[ { fillColor:'rgba(225,10,24,0.2)', strokeColor:'rgba(11,255,20,1)', pointColor:'rgba(111,200,200,1)', pointStrokeColor:'#fff', pointHighlightFill:'#fff', pointHighlightStroke:'rgba(200,100,10,0.8)' }, ... (3x) to the component.ts. Are any other package imports necessary to change the color or is the setup wrong? Chromes html inspector shows the following html output rendered: ng-reflect-colors="[object Object],[object Object],[object Object]" | |
| OSCHINA 社区最新新闻 Posted: 14 Jul 2022 12:15 PM PDT | Go 1.19 RC1 发布,正式版预计在 8 月推出 Posted: 14 Jul 2022 01:18 AM PDT Go 1.19 发布了第一个 RC 版本,正式版预计在 8 月推出。 主要变化 针对"泛型"的 Bugfix 更新内存模型,与 C、C++、Java、JavaScript、Rust 和 Swift 使用的内存模型保持一致 Go 1.19 在启动时将默认提高打开文件的限制值 Go 1.19 race detector 将升级到 v3 版 thread sanitizer Go 1.19 增加"unix" build tag 在 Li... | | 版本通告|Apache Doris 1.1 Release 版本正式发布! Posted: 13 Jul 2022 11:59 PM PDT 以下内容源自 Apache Doris 官网(https://doris.apache.org/ ),复制到浏览器打开。 亲爱的社区小伙伴们,我们很高兴地宣布,Apache Doris 在 2022 年 7 月 14 日迎来 1.1 Release 版本的正式发布!这是 Apache Doris 正式从 Apache 孵化器毕业后并成为 Apache 顶级项目后发布的第一个 Release 版本。 在 1.1 版本中,... | | 云原生 DevOps 现状调研问卷征集:KodeRover 联合 OSCHINA 推出 Posted: 13 Jul 2022 08:02 PM PDT 过去几十年,新技术层出不穷,它们是如何改变软件工程师的工作方式的?又是如何影响软件公司的工作方式的? | | Neuron 2.1.0 发布:支持 Sparkplug B 规范,更完善的工业协议支持 Posted: 13 Jul 2022 06:43 PM PDT 近日,Neuron 2.1.0 正式发布。这是 Neuron 开源后的首个子版本,在 v2.0.0 的基础上对核心代码进行了重构,通过无锁核心提升了产品稳定性。此外 Neuron 2.1.0 还完成了与边缘流式处理引擎 eKuiper 的集成,实现了一站式的边缘数据采集与处理。新增的 Sparkplug B 规范支持和多个驱动插件,也为 Neuron 用户构建符合工业... | | 最新版 Opera 引发 Windows 可靠性监视器错乱 Posted: 13 Jul 2022 05:29 PM PDT Opera 在上周发布了 Opera 89 稳定版,带来了多项新功能和问题修复,但近日 ghacks 发现这个版本似乎也给浏览器引入了一些问题。该问题会让 Opera 浏览器启动时在 Windows 可靠性监视器中占据多个应用程序条目,引发错乱,而这些应用本身与 Opera 浏览器并不相关。 现在只要启动 Opera,Windows 上的可靠性监视器中就会多... | | Rust 核心团队争议性成员退出,Rust subreddit 锁帖控评 Posted: 13 Jul 2022 05:20 PM PDT Rust 核心团队 (Core Team) 发布公告称,成员 Aidan Hobson Sayers 和 Ashley Williams 将退出核心团队。 我们要告别并感谢几个从核心团队退出的人: Aidan Hobson Sayers 将离开核心团队并卸任其他职位。他于 2018 年加入核心团队,一开始在项目中负责解决 CI 问题,自基础架构团队成立以来一直是其成员(历任领导和联席... | | 字节 OSPO 将投入超十人全职团队 Posted: 13 Jul 2022 05:18 PM PDT 2022 年 5 月,字节跳动官宣成立开源委员会,这一举动在业界的意料之中。由此,开源中国编辑部请到了字节跳动开源委员会治理运营负责人张鑫,让他来谈谈字节跳动成立 OSPO 的前因后果。 | | Matt Hick 被任命为 Red Hat 新总裁兼 CEO Posted: 13 Jul 2022 05:17 PM PDT Red Hat 公告显示,Matt Hicks 于 2022 年 7 月被任命为 Red Hat 的新总裁兼 CEO ,接替上一任 CEO Paul Cormier 的职位。 上一任总裁 Paul Cormier 在 2001 年加入 Red Hat ,参与了红帽的 Linux 平台开发,并将它从一个免费下载的操作系统成功商业化,转化为现在广为人知的基于订阅模式的红帽企业 Linux (RHEL) ,成... | | NoobBoy —— C++ 编写的 GameBoy 模拟器 Posted: 13 Jul 2022 05:15 PM PDT NoobBoy 是 C++ 编写的简易 GameBoy 模拟器。 | | 每日一博 | RocketMQ 之消费者启动与消费流程 Posted: 13 Jul 2022 05:13 PM PDT RocketMQ 是由阿里巴巴开源的分布式消息中间件,支持顺序消息、定时消息、自定义过滤器、负载均衡、pull/push 消息等功能。RocketMQ 主要由 Producer、Broker、Consumer 、NameServer 四部分组成,其中 Producer 负责生产消息,Consumer 负责消费消息,Broker 负责存储消息。NameServer 充当名字路由服务。... | | Gitee 推荐 | Android 属性动画库 WuKongAnimation Posted: 13 Jul 2022 05:10 PM PDT 一个优雅的代码动画库。支持直接函数调用和链式调用。内部封装 Tween 来作为动画内核。 | | Linux Mint 21 Beta 发布 Posted: 13 Jul 2022 04:34 PM PDT Linux Mint 21 "Vanessa" 的开发工作在几个月前启动,即将发布的版本将基于 Canonical 最新的 Ubuntu 22.04 LTS(Jammy Jellyfish)操作系统系列,Linux Mint 21 也会跟 Ubuntu 22.04 LTS 一样在未来五年内得到支持。 Linux Mint 21 不仅将搭载 Ubuntu 22.04 LTS 的较新核心组件(如 Linux 内核、Mesa 图形堆栈、GCC、G... | | Android 13 最后一个测试版发布 Posted: 13 Jul 2022 04:27 PM PDT Google 于今天正在推出 Android 13 Beta 4,该版本也是 Android 13 的最后一个测试版,Android 13 将在未来几周时间内正式发布。 衷心感谢我们的开发者社区,你们给我们提供了数以千计的错误报告和见解,帮助我们优化API、改进功能、修复重大错误,并使平台对用户和开发人员更友好。 对于开发者来说,Android 13 Beta 4... | | FileZilla Server 1.5-rc1 发布,开源 FTP 服务器 Posted: 13 Jul 2022 04:25 PM PDT FileZilla Server 是一个免费开源的 FTP 和 FTPS 服务器,能够提供与服务器的安全加密连接。Filezilla Server 没有实现对 SFTP(SSH 文件传输协议)的支持。 FileZilla Server 1.5-rc1 发布,更新内容如下: 新功能: Server:在失败次数过多的情况下,实现了登录尝试的限制 Server:欢迎信息中的版本号现在可以通过将配... | | LibreOffice 7.4 RC1 发布,开源办公套件 Posted: 13 Jul 2022 04:04 PM PDT LibreOffice 7.4 RC1 现已发布。自上次 LibreOffice 7.4 Beta1 发布以来,已向代码库提交了 280 个 commit,121 个 bug 得到了修复。LibreOffice 7.4 的开发工作于 2021 年 11 月启动,计划于 2022 年 8 月中旬正式发布,并且这个系列将被支持到 2023 年 6 月 12 日。 LibreOffice 7.4 带来了各种性能改进,包括有: 支持... | | Git for Windows 2.37.1 发布 Posted: 13 Jul 2022 04:02 PM PDT Git for Windows 2.37.1 现已发布,主要更新内容如下: New Features 随附 Git v2.37.1。 随附 OpenSSL v1.1.1q。 随附 Git Credential Manager Core v2.0.785。 随附 tig v2.5.5。 Bug 修复 在 Windows Terminal 中运行时,在 Git for Windows 的 Bash 中粘贴大量文本通常会导致文本乱码,该问题已得到修复。 Perl 模块... | | Seata 1.5.2 发布,支持批量消息并行处理 Posted: 13 Jul 2022 04:01 PM PDT Seata 是一款开源的分布式事务解决方案,提供高性能和简单易用的分布式事务服务。 目前 Seata 发布了 1.5.2 版本,带来如下修改: 新功能 [ #4661 ] 支持 xid 一致性负载均衡 [ #4676 ] 支持服务器通过挂载 SLB 暴露 Nacos 服务 [ #4642 ] 支持批量消息并行处理 [ #4567 ] 支持 where 方法条件(find_in_set) 修复 [ #4... | | KDE Plasma 5.25.3 发布,带来多项优化 Posted: 13 Jul 2022 04:01 PM PDT KDE 项目目前在维护 Plasma 桌面环境的两个稳定分支,长期支持的 Plasma 5.24 LTS 和短期支持的 5.25 系列。目前 KDE Plasma 5.25.3 已发布,这是对 KDE Plasma 5.25 桌面系列的第三次维护更新。 此版本对 Plasma Wayland 会话进行了更多修复,解决了将屏幕分辨率更改为显示器不支持的分辨率时,系统设置崩溃的问题。此外... | |
| Recent Questions - Server Fault Posted: 14 Jul 2022 12:01 PM PDT | Repository of regular expressions for logs Posted: 14 Jul 2022 11:22 AM PDT Does a public repository of regular expressions exist for parsing out the dynamic fields of common logs on Linux machines? SSH logins, kernel faults, etc. | | Managing WSUS with Powershell. How to remove an automatic approval rule? Posted: 14 Jul 2022 10:30 AM PDT I'm writing Powershell scripts to manage WSUS. One script can create, read, and update automatic approval rules. But it can't delete rules. WSUS allows admins to make rules with duplicate names. If there are multiple rules with the same name, the script needs to remove the duplicates before proceeding. I can't find a method to do that. I'm pulling a lot of information from Microsoft's documentation on the WSUS Class Library (https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms744624(v=vs.85)) The script I have needs to set an automatic update approval rule to the right settings. $myServer = Get-WsusServer $rule = $myServer.GetInstallApprovalRules() | Where-Object {$_.Name -eq 'WSUS Automation Rule'} #This returns data type Microsoft.UpdatesServices.Internal.BaseApi.AutomaticUpdateApprovalRule #********************************* Need code here**************** if ($rule.count -gt 1){ #If there is more than one rule named 'WSUS Automation Rule', delete the duplicates. } #********************************* Need code here**************** if ($rule = $null){ #If there is no rule with that name, make one. $rule = $myServer.CreateInstallApprovalRule('WSUS Automation Rule') } #Snipped code. Create a list of update classifications in $classifications. #Snipped code. Create a list of update categories in $categories. $rule.setSetUpdateClassifications($classifications) $rule.setCategories($categories) $rule.save() $rule.apply() | | How is my DNSSEC enabled domain still serving a tiny number of NXDOMAIN response codes? Posted: 14 Jul 2022 11:03 AM PDT I enabled DNSSEC on my primary domain about a week ago. It's not a major website or anything -- just my personal domain name that I use for email and the like (TLD: com; DNSSEC algorithm 13; authoritative DNS provider: Cloudflare). Over the last 24 hours, the domain has received 15,605 queries. In response, it has dished out 15,601 NOERROR response codes and a total of 4 NXDOMAIN response codes. How are NXDOMAIN responses still possible? What could be generating them? Personally I cannot trigger one no matter what query I attempt, and my understanding is that DNSSEC should, at least in theory, eliminate this response code entirely. Am I incorrect? | | Outlook not expanding M365 Groups Posted: 14 Jul 2022 08:48 AM PDT Good morning Folks. I am having some issues and I am going to try and explain this to the best of my ability. I am reorganizing our Azure environment and part of that is converting mail enabled security groups to dynamic M365 groups. There is about 1600 groups. My PowerShell script to do this has been created and is working as expected. I have not made these changes to all 1600 groups my D-DAY is the 22nd. This brings me to my issue. When I created my test groups, I noticed that when I pull up the new group in the "To" field in outlook (pulled from the GAL, not using the autocomplete) I noticed that when I hover over the new group email in the "To" field I get a pop up saying there are no members in that group. I checked in Azure and o365 and I have all my 10 users in there, pulled in using my dynamic rule syntax. I do not know why it is showing no members. Being able to see who is in those groups will be well used by our users and something like this will generate a whole bunch of support calls\tickets. When I try to expand the group, I get an error saying "Cannot perform the requested operation. The command selected in not valid for this recipient. The operation failed" If anyone has any ideas I would love to hear them. Thank you Johan | | Linux monthly network usage for virtual interfaces Posted: 14 Jul 2022 08:43 AM PDT I'm looking for something to keep track of network usage (rx and tx) for all virtual interfaces, not just the main interface. I tried vnstat, but it only recognizes the main interface. Any help is appreciated! | | Can php-fpm and swoole coexist on the same virtual host /server block Posted: 14 Jul 2022 08:04 AM PDT I have been searching for days, and apart from this unanswered question os Stack Overflow no info whatsoever has appeared, a big zero. So I wonder if the wise people around here might know of a working nginx or apache configuration where swoole and php-fpm can coexist | | Best way to do 301 redirects Posted: 14 Jul 2022 08:04 AM PDT Which is the best way to do 301 redirects (for whole domains and also for specific pages/directories)? Using Apache virtual blocks, .htaccess or other solutions? "Best" for me probably means the fastest and most SEO-friendly option, but maybe there are other important factors (security, easier to configure and maintain...). Right now I'm using Apache, but for example for https apparently always checks the certificate of the old domain before redirecting to the new one, so maybe there are faster solutions? (I don't really know much about this subject, just asking) Thanks! | | If I have multiple versions of Postgres installed, how do I use a version specific tool? Posted: 14 Jul 2022 07:58 AM PDT For development reasons I have both Postgres 12 and 14 installed on my local machine. However, often I also need to use the pg_dump utility to create backups. pg_dump 12 won't connect to a Postgres 14 database and viceversa. If I simply run pg_dump, Ubuntu will use the one in /bin by default which is pg_dump@12. If I want to run version 14 I have to manually type: /usr/lib/postgresql/14/bin/pg_dump Is there any way I can quickly switch between them? Something like: pg_dump@14 | | Are on-prem Windows Virtual Desktop servers still a thing? Posted: 14 Jul 2022 07:40 AM PDT My supervisor wants me to look into a virtual Windows 10/11 desktop solution leveraging our on-prem VMware cluster. Luckily, our cluster hardware has plenty of CPU/RAM/storage to accomplish the scope of the solution. The issue I'm running into is finding tutorials on how to set this up using Windows Server 2022-era products. All the solutions I can find seem to require an Azure tenant. I would have no issues recommending an Azure-integrated solution, except for the kicker: My company's Azure tenant is managed by a non-US corporation, to which we have no administrative access and getting an Azure VDI solution in place is so convoluted as to be effectively impossible. I know Windows Virtual Desktop is old tech and I totally understand why Microsoft is pushing Azure cloud services instead of on-prem solutions, but my situation dictates that I come up with an on-prem solution that will have the potential to last the next 3-5 years without Microsoft killing it with EoL support and security update cancellations. My question is two-fold: - Is Microsoft Virtual Desktop still a thing, and if so, where can I find some tutorials (preferable video-based, like YouTube) on setting it up?
- Is an on-prem, Windows-based VDI solution viable (even if you wouldn't recommend it over Azure, Horizon VDI, or Citrix) for the next 3-5 years (until my company gets with the times and moves to the cloud)?
| | Is a valid SSL certificate important when accessing a localhost URL via SSH tunnel? Posted: 14 Jul 2022 08:24 AM PDT I've got a PHPMyAdmin installation set up, but accessible only via localhost. This means that to access the URL, I need to set up an SSH tunnel before I access the URL. When I do so, however, I get a warning saying that the SSL connection is unsafe because the certificate is not valid (my domain has a valid certificate). Is it safe to bypass this, considering I have many users who will be accessing the URL via SSH tunnel? If it is not, what do I have to do to rectify this issue? | | Finding the ESX/ESXi host in vSphere cluster on which a virtual machine is running programmatically via REST API Posted: 14 Jul 2022 07:14 AM PDT For any powered on VM in a given folder I want to retrieve its IP address and the ESXi host it's running on. I'm haveing problems finding an REST API endpoint to retrieve the ESXi host a VM is running. Albeit I'm able to retrieve the IP addresses of the VMs like so: 1. Get Session ID curl -X "POST" "https://vsphere.company.tld/rest/com/vmware/cis/session" \ -H 'vmware-use-header-authn: test' \ -u 'username:password' Output { "value": "random-session-id" } 2. Get all VMs from a folder curl "https://vsphere.company.tld/rest/vcenter/vm?filter.power_states=POWERED_ON&filter.folders=group-v40515" \ -H 'vmware-api-session-id: random-session-id' \ -H 'Accept: application/json' Output { "value": [ { "memory_size_MiB": 4096, "vm": "vm-40572", "name": "runner-br2z81xk-1657760400-7de8fc3e", "power_state": "POWERED_ON", "cpu_count": 2 }, { "memory_size_MiB": 4096, "vm": "vm-40573", "name": "runner-br2z81xk-1657760400-a2d27360", "power_state": "POWERED_ON", "cpu_count": 2 } ] } 3. Get details (IP address) of VM curl "https://vsphere.company.tld/rest/vcenter/vm/vm-40572/guest/identity" \ -H 'vmware-api-session-id: random-session-id' \ -H 'Accept: application/json' Output { "value": { "full_name": { "args": [], "default_message": "Other 4.x or later Linux (64-bit)", "id": "vmsg.guestos.other4xLinux64Guest.label" }, "name": "OTHER_4X_LINUX_64", "ip_address": "192.168.14.19", "family": "LINUX", "host_name": "runner-br2z81xk-1657760400-7de8fc3e" } } Does one know a way to retrieve the ESXi host for a given VM? I can see the ESXi host easily from the vSphere web UI. But don't find a suitable API endpoint in the vCenter api documentation. | | Where sieve file must be located if dovecot runs with virtual_mailbox_maps Posted: 14 Jul 2022 07:33 AM PDT I have postfix + dovecot install that uses virtual_mailbox_maps I want to do sieve for specific users. where I should put the sieve file, since there are no user directories? In dovecot configuration I have this: plugin { sieve_extensions = +editheader sieve_editheader_max_header_size = 1k # Protected special headers sieve_editheader_forbid_add = X-Verified sieve_editheader_forbid_delete = X-Verified X-Seen sieve_redirect_envelope_from = recipient sieve = /etc/dovecot/sieve/default.sieve } However, i do not want to use default.sieve, I want additional sieve file for specific users. | | Create proxy server from home modem Posted: 14 Jul 2022 07:15 AM PDT I live in New Delhi, India. I have virtual machines at Hetzner cloud (Finland, Helsinki). Each VM has a static IP address from Finland, Helsinki. I run some applications on the VM. How do I set the ip address of my internet connection at my home location, ac as a proxy ip of my VM ?So that: - The real ip from Finland is hidden
- All requests from VM go through the ip address of my internet connection at home
- All requests are forwarded to the VM
| | Files can't be uploaded on Google cloud after deleting user folder Posted: 14 Jul 2022 11:15 AM PDT I'm using CentOS 7 on Google Cloud. I deleted accidentally the folder with my username, /home/username, that folder was used for uploading files via Google SSH. I've created a folder with the same name. But now I can't upload any files. Is there something else I have to configure? | | If 'dnssec-enable' is obsolete and must be removed, what is the alternative when creating a DNS server on BIND 9? Posted: 14 Jul 2022 07:10 AM PDT | | qemu commandline can't see /dev/net/tun Posted: 14 Jul 2022 08:40 AM PDT i am newbie with qemu and libvirt. I hit the issue with virsh and qemu, especially with tun interface setup. Once i run qemu-system-x86_64 \ -nographic -enable-kvm \ -cpu host -m 2048 \ -serial mon:stdio \ -netdev tap,id=et0,ifname=tap0,script=no -device e1000,netdev=et0 It works without problem, it also creates tap0 interface at host machine. The problem comes up when i try to create VM using libvirt xml: <domain type="kvm" xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> <name>testttt</name> <uuid>21ddfabd-1312-45ad-aced-cf7a10257d83</uuid> <memory unit="MB">2048</memory> <currentMemory unit="MB">2048</currentMemory> <vcpu placement="static">1</vcpu> <os> <type arch="x86_64" machine="pc-i440fx-6.2">hvm</type> <boot dev="hd"/> </os> <features> <acpi/> <apic/> <vmport state="off"/> </features> <cpu mode="host-passthrough" check="none" migratable="on"/> <clock offset="utc"> <timer name="rtc" tickpolicy="catchup"/> <timer name="pit" tickpolicy="delay"/> <timer name="hpet" present="no"/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <pm> <suspend-to-mem enabled="no"/> <suspend-to-disk enabled="no"/> </pm> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type="file" device="disk"> <driver name="qemu" type="vdi"/> <source file="..."/> <target dev="hda" bus="ide"/> <address type="drive" controller="0" bus="0" target="0" unit="0"/> </disk> <controller type="usb" index="0" model="ich9-ehci1"> <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x7"/> </controller> <controller type="usb" index="0" model="ich9-uhci1"> <master startport="0"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0" multifunction="on"/> </controller> <controller type="usb" index="0" model="ich9-uhci2"> <master startport="2"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x1"/> </controller> <controller type="usb" index="0" model="ich9-uhci3"> <master startport="4"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x2"/> </controller> <controller type="pci" index="0" model="pci-root"/> <controller type="ide" index="0"> <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/> </controller> <controller type="virtio-serial" index="0"> <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0"/> </controller> <serial type="pty"> <target type="isa-serial" port="0"> <model name="isa-serial"/> </target> </serial> <console type="pty"> <target type="serial" port="0"/> </console> <channel type="spicevmc"> <target type="virtio" name="com.redhat.spice.0"/> <address type="virtio-serial" controller="0" bus="0" port="1"/> </channel> <input type="mouse" bus="ps2"/> <input type="keyboard" bus="ps2"/> <graphics type="vnc" port="-1" autoport="yes"> <listen type="address"/> </graphics> <video> <model type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"/> <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/> </video> <redirdev bus="usb" type="spicevmc"> <address type="usb" bus="0" port="2"/> </redirdev> <redirdev bus="usb" type="spicevmc"> <address type="usb" bus="0" port="3"/> </redirdev> <memballoon model="virtio"> <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/> </memballoon> <rng model="virtio"> <backend model="random">/dev/urandom</backend> <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/> </rng> </devices> <qemu:commandline> <qemu:arg value='-serial'/> <qemu:arg value='mon:stdio'/> <qemu:arg value='-device'/> <qemu:arg value='e1000,netdev=et0'/> <qemu:arg value='-netdev'/> <qemu:arg value='tap,id=et0,script=no,downscript=no,ifname=tap0'/> </qemu:commandline> </domain> The machine got created but once i try to run it i get folllowing error: internal error: qemu unexpectedly closed the monitor: 2022-07-13T12:12:59.151035Z qemu-system-x86_64: -netdev tap,id=et0,script=no,downscript=no,ifname=tap0: could not open /dev/net/tun: No such file or directory I think, there is something wrong with: <qemu:commandline> <qemu:arg value='-serial'/> <qemu:arg value='mon:stdio'/> <qemu:arg value='-device'/> <qemu:arg value='e1000,netdev=et0'/> <qemu:arg value='-netdev'/> <qemu:arg value='tap,id=et0,script=no,downscript=no,ifname=tap0'/> </qemu:commandline> I ran cat /dev/net/tun and get cat: /dev/net/tun: File descriptor in bad state so the tun should be ok, also it works in when i run qemu-system-x86_64. | | Using Office 365 now, can we pilot intune MDM on just 1-2 users or devices? Posted: 14 Jul 2022 10:51 AM PDT We have Microsoft hosting for exchange, office 365, defender for endpoint and are using the Office 365 MDM for device management. We only have Azure AD basic not premium. I've started an intune trial, created a Windows 10 VM as a device, added AD-based user, added the device and user to an intune group with policy and installed the company store app from the Windows store. In that app, settings > sync runs without errors. The device shows up in the intune device list and is compliant, but managed apps never sync. They are stuck at "Waiting for install status" My guess is this is because our MDM is Office 365, but I don't see any way in the admin panel or in any docs I've found to change that for just this test user, or the test device, or the intune group. Is there some way to force intune to be the MDM for just this user, device, group? Additional information: On the device, Settings > Accounts > Access Work or School shows the device as "Connected to (company) MDM" (which will be the office 365 MDM?) and "Connected to (company)'s Azure AD" In intune, DESKTOP-xxxxxx | Enrollment table shows "no results" for the device Is that significant? Joining AD and installing the company portal are both supposed to enroll the user or device if I'm reading the docs right. | | nginx reverse proxy - proxy_pass leads to 503 service unavailable Posted: 14 Jul 2022 08:37 AM PDT i have to following configuration: server { listen: 8080; location / { proxy_pass https://somehost.abc.xyz; proxy_redirect off; proxy_set_header Host somehost.abc.xyz; proxy_set_header X-Real-IP somehost.abc.xyz; proxy_set_header X-Forwarded-For somehost.abc.xyz; proxy_set_header X-Forwarded-Host somehost.abc.xyz; proxy_set_header HELLO pizza; } } Whenever i hit the the proxy, let's say i go to http://localhost:8080/home , i get 503 service unavailable (not from the nginx service, from the app i'm trying to go to https://somehost.abc.xyz/home). But if i just go to https://somehost.abc.xyz/home or do a redirect return 301 https://somehost.abc.xyz/home; its all good and i get to the app. Although this doesn't help me, beacuse i want to get there through the proxy so i can add a request header to every request that goes through. Any ideas what could possibly cause this and how to solve it? | | GCP - Shared VPC vs VPC Peering among projects - main differences? Posted: 14 Jul 2022 08:52 AM PDT I'm testing various GCP features and I've faced with the question in the title. After a little bit of experimentation I think the following should hold: - 2 peered VPC can not share the same subnet ranges, while VPC sharing is sharing the same subnets: if we want instances to communicate and we adjust firewall (FW) rules, does this make any practical difference?
- Shared VPC creates a hierarchical relation where one end is the manager of the network and FW rules and therefore can dictate all service projects abilities and can revoke shares, this also means that the host part must have access to service projects to let pick them and allow them to use the host project VPCs. Anyway VPC peering require a certain level of access to projects if one wants to peer them, but the 2 projects are on-par (both ends must allow the peering): this is an administrative/auth difference
- Shared VPC allows for a simplified FW setup as you have only one central point to setup your FW rules: you have the same set of subnets shared; while peering - alike VPNs - requires to setup rules on both ends: this is a management simplification
- Shared VPC can exhaust its resources (IPv4 ranges) faster but this means you have a ton of instances connected...
- VPC peering can do passthrou (daisy chain) up to 1 level: I've 1 connection from VPC A to VPC B and one from VPC B to VPC C. VPC A and C can not communicate but VPC B can communicate with both. On the opposite in a share scenario a project can only be either a host or a service at the same time but I can create a scenario with multiple projects sharing the same subnet and talk to each other transitively... this is probably the most relevant difference I've seen
Let say we have N different projects with N different administrators, if all parts agree on having some sort of network connection among instances, is there any other pro/cons in choosing peering over shared?! Edit - maybe this is the really biggest difference: if a service project uses a shared VPC and you later want to remove it, you need first to create a new VPC (or use the service project's default), reassign a new nic to all the instances which are currently using the shared VPC, let this new nic use the project own VPC, redo the FW rules and check for correct connectivity of all instances before detaching them from the shared VPC.
- additionally VPC peering can be used within the same project to increase the isolation between workloads but letting few selected VM communicate.
Edit 2 - As of now (2021-01) shared VPC can be used on a second NIC but it is a beta feature
- also one can not add more than 25 peering to a network, therefore it is quite common to let project communicate via shared VPC in so-called hub-and-spoke designs.
- Just discovered that VPC peering can be applied even between different organizations!
Edit 3 While not a strictly network architecture, Google now offers also Private service access: a way to proxy external services (including those in other projects/VPCs) via a proxy in your VPC Thank you | | SFTP users can't remove files Posted: 14 Jul 2022 10:05 AM PDT I've set up a simple SFTP server on Ubuntu 18.04. I have 10 users that should only have access to the files in their home directories and they should not be able to get out of their home directory. We have an API that is writing files to their home directories. So far, so good. The users can login, retrieve the files, and are constrained to their own directories. They cannot, however, remove the files. Any 'rm' command returns a permissions error - Couldn't delete file: Permission denied. The user/group for the folder is root:www-data. If I change it to user:www-data SFTP breaks - they can't login. I created a group 'sftp' but again if I add the user to the sftp group, change the home directory to user:sftp they can't login. Here's what the home folder looks like: drwxr-xr-x 2 root www-data 172032 Feb 6 14:19 29 drwxr-xr-x 2 root www-data 135168 Feb 6 14:17 52 drwxr-xr-x 4 root www-data 69632 Feb 6 14:15 44 drwxr-xr-x 2 root www-data 36864 Feb 6 14:14 68 My sftp config from /etc/ssh/sshdconfig is: Match group sftp ChrootDirectory /home/%u X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp My users are set up like this: 29:x:1002:1001::/home/26:/bin/sh 44:x:1003:1003::/home/44:/bin/sh 52:x:1004:1004::/home/52:/bin/sh 68:x:1005:1005::/home/29:/bin/sh My sftp group is: sftp:x:1001:26,44 | | Slow DNS resolution inside docker container Posted: 14 Jul 2022 11:04 AM PDT I've stuck with a problem of a very slow DNS resolution inside docker container. Simple GET to a 'google.com' takes about 4s to finish while the same request on host takes 0.052 ms. Also request works perfectly if I send it to an IP address that's why I suggested DNS problem. I've searched for an answer most of them were about setting dns servers in a /etc/docker/daemon.json which I did but that didn't help my problem. Server runs on Ubuntu 16.04. I also have a dev server which runs same configurations but it works fine. Host: time curl -g 'google.com' <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="http://www.google.com/">here</A>. </BODY></HTML> real 0m0.052s user 0m0.004s sys 0m0.004s time nslookup google.com Server: 188.93.16.19 Address: 188.93.16.19#53 Non-authoritative answer: Name: google.com Address: 173.194.73.102 Name: google.com Address: 173.194.73.139 Name: google.com Address: 173.194.73.100 Name: google.com Address: 173.194.73.113 Name: google.com Address: 173.194.73.138 Name: google.com Address: 173.194.73.101 real 0m0.013s user 0m0.004s sys 0m0.004s Container: time curl -g https://google.com <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="https://www.google.com/">here</A>. </BODY></HTML> real 0m4.592s user 0m0.004s sys 0m0.012s time nslookup google.com Server: 127.0.0.11 Address: 127.0.0.11#53 Non-authoritative answer: Name: google.com Address: 64.233.165.139 Name: google.com Address: 64.233.165.101 Name: google.com Address: 64.233.165.102 Name: google.com Address: 64.233.165.113 Name: google.com Address: 64.233.165.100 Name: google.com Address: 64.233.165.138 real 0m4.029s user 0m0.008s sys 0m0.004s daemon.json: { "dns": ["188.93.16.19", "188.93.17.19", "8.8.8.8", "8.8.8.4"] } | | GCP Equivalent for AWS Landing zone solution Posted: 14 Jul 2022 07:13 AM PDT AWS provides a solution called Landing Zone to jumpstart cloud adoption for an enterprise. This solution is based on AWS best practices. It provides a starting point by auto creating multiple accounts and configures shared services such as logging, monitoring etc. Is there an equivalent solution for GCP ? | | Azure RDS HTML5 Web Client Unable to Access Gateway Posted: 14 Jul 2022 10:05 AM PDT We have a RDS (Remote Desktop Services) deployment, and recently went through the process of installing the HTML5 web client as per the directions at: https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-web-client-admin Our deployment is hosted on domain A, which has an active directory instance. There is also domain B with its own active directory instance, there is a two way trust between the two. The problem we are having is that the traditional RD Web Access works fine for all users, but when users from domain B log on to the HTML 5 web client and try to open an app they get a message "We couldn't connect to the gateway because of an error". At the same time the browser console shows the following error: Connection(ERR): The connection generated an internal exception with disconnect code=GatewayProtocolError(52), extended code=, reason=Gateway tunnel authorization failed with error code=2147965403 During troubleshooting we've tried: - Verified that required ports are opened.
- Disabling all firewalls between gateways, brokers, and session hosts – same error.
- Re-applied the publicly trusted cert to the HTML5 client (via Import-RDWebClientBrokerCert) – same error
- Verified that the proper cert was bound to the HTML5 client – same error.
- Enabled NTLM by setting the GPO: Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> Network Security: Restrict NTLM: NTLM Authentication in this domain. To "Disable" (within same domain as RDP) – same error.
- Ran regsvr32 wksprtps.dll (dll was already registered, but tried it anyway)
- Verified that the required KB4025334 from July of last year was installed or not necessary (OS was up to date)
Any ideas on other areas we can look at? | | Uninstall Symantec Endpoint Protection 12.1 (with uninstall password) using PowerShell? Posted: 14 Jul 2022 07:07 AM PDT We just acquired 400 or so computers during a buyout and they have this installed. So I tried pushing out (Get-WmiObject -Class Win32_Product -Filter "Name='Symantec Endpoint Protection'" -ComputerName . ).Uninstall() as per https://support.symantec.com/en_US/article.TECH102470.html which unsurprisingly doesn't work. I was getting ReturnValue 1602 and not ReturnValue 0. Tried uninstalling it manually on a client using Add/Remove Programs and it needs a password which I've now managed to get from the old company. Any idea how we can use PowerShell to uninstall this with a password? It's SEP 12.1. | | squid proxy on ubuntu refuses connections Posted: 14 Jul 2022 07:07 AM PDT I have just installed squid on my Ubuntu server. However when I try to connect, I receive connection refused messages from my local computer (In the firewalls I have added permits for my local IP) Below you can find the squid configuration and the cachlog. Any support will be appreciated. /etc/squid/squid.conf acl mylocalip xxx.xxx.xxx.xxx/32 acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT http_access allow mylocalip http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost manager http_access deny manager http_access allow localhost http_access deny all http_port 19228 coredump_dir /var/spool/squid refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 refresh_pattern . 0 20% 4320 /var/log/squid/cache.log 2017/09/16 10:07:07 kid1| Set Current Directory to /var/spool/squid 2017/09/16 10:07:07 kid1| Starting Squid Cache version 3.5.23 for x86_64-pc-linux-gnu... 2017/09/16 10:07:07 kid1| Service Name: squid 2017/09/16 10:07:07 kid1| Process ID 9499 2017/09/16 10:07:07 kid1| Process Roles: worker 2017/09/16 10:07:07 kid1| With 65535 file descriptors available 2017/09/16 10:07:07 kid1| Initializing IP Cache... 2017/09/16 10:07:07 kid1| DNS Socket created at [::], FD 6 2017/09/16 10:07:07 kid1| DNS Socket created at 0.0.0.0, FD 8 2017/09/16 10:07:07 kid1| Adding nameserver 169.254.169.254 from /etc/resolv.conf 2017/09/16 10:07:07 kid1| Adding nameserver 127.0.0.53 from /etc/resolv.conf 2017/09/16 10:07:07 kid1| Adding domain c.bibipcom-174407.internal from /etc/resolv.conf 2017/09/16 10:07:07 kid1| Adding domain google.internal from /etc/resolv.conf 2017/09/16 10:07:07 kid1| Logfile: opening log daemon:/var/log/squid/access.log 2017/09/16 10:07:07 kid1| Logfile Daemon: opening log /var/log/squid/access.log 2017/09/16 10:07:07 kid1| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec 2017/09/16 10:07:07 kid1| Store logging disabled 2017/09/16 10:07:07 kid1| Swap maxSize 0 + 262144 KB, estimated 20164 objects 2017/09/16 10:07:07 kid1| Target number of buckets: 1008 2017/09/16 10:07:07 kid1| Using 8192 Store buckets 2017/09/16 10:07:07 kid1| Max Mem size: 262144 KB 2017/09/16 10:07:07 kid1| Max Swap size: 0 KB 2017/09/16 10:07:07 kid1| Using Least Load store dir selection 2017/09/16 10:07:07 kid1| Set Current Directory to /var/spool/squid 2017/09/16 10:07:07 kid1| Finished loading MIME types and icons. 2017/09/16 10:07:07 kid1| HTCP Disabled. 2017/09/16 10:07:07 kid1| Pinger socket opened on FD 13 2017/09/16 10:07:07 kid1| Squid plugin modules loaded: 0 2017/09/16 10:07:07 kid1| Adaptation support is off. 2017/09/16 10:07:07 kid1| Accepting HTTP Socket connections at local=[::]:3128 remote=[::] FD 11 flags=9 2017/09/16 10:07:07| pinger: Initialising ICMP pinger ... 2017/09/16 10:07:07| pinger: ICMP socket opened. 2017/09/16 10:07:07| pinger: ICMPv6 socket opened 2017/09/16 10:07:08 kid1| storeLateRelease: released 0 objects 2017/09/16 10:18:33 kid1| Preparing for shutdown after 0 requests 2017/09/16 10:18:33 kid1| Waiting 30 seconds for active connections to finish 2017/09/16 10:18:33 kid1| Closing HTTP port [::]:3128 2017/09/16 10:18:33 kid1| Closing Pinger socket on FD 13 2017/09/16 10:18:48| Pinger exiting. 2017/09/16 10:19:04 kid1| Shutdown: NTLM authentication. 2017/09/16 10:19:04 kid1| Shutdown: Negotiate authentication. 2017/09/16 10:19:04 kid1| Shutdown: Digest authentication. 2017/09/16 10:19:04 kid1| Shutdown: Basic authentication. 2017/09/16 10:19:04 kid1| Shutting down... 2017/09/16 10:19:04 kid1| storeDirWriteCleanLogs: Starting... 2017/09/16 10:19:04 kid1| Finished. Wrote 0 entries. 2017/09/16 10:19:04 kid1| Took 0.00 seconds ( 0.00 entries/sec). CPU Usage: 0.064 seconds = 0.060 user + 0.004 sys Maximum Resident Size: 106000 KB Page faults with physical i/o: 0 2017/09/16 10:19:04 kid1| Logfile: closing log daemon:/var/log/squid/access.log 2017/09/16 10:19:04 kid1| Logfile Daemon: closing log daemon:/var/log/squid/access.log 2017/09/16 10:19:04 kid1| Open FD UNSTARTED 6 DNS Socket IPv6 2017/09/16 10:19:04 kid1| Open FD UNSTARTED 8 DNS Socket IPv4 2017/09/16 10:19:04 kid1| Open FD UNSTARTED 9 IPC UNIX STREAM Parent 2017/09/16 10:19:04 kid1| Squid Cache (Version 3.5.23): Exiting normally. | | SMTP network ACL on AWS Posted: 14 Jul 2022 11:04 AM PDT I have a very restricted ACL for my VPC. We have a public subnet and a private subnet, each subnet has its own individual ACL. What I don't understand is why the following ACL works for sending email over port 465 via Amazon SES. public: - inbound: src 0.0.0.0/0, port 465
- outbound: dest 0.0.0.0/0, port 465
private: - inbound: N/A
- outbound: dest 0.0.0.0/0, port 465
I get both outbound, but the inbound for public doesn't make any sense. Where in the SMTP RFC say the smtp server (SES, a relay) will connect with the client back on port 465? I would expect client pick a high port as shown in the following netstat: tcp 104 0 ip-10-0-1-75.ec:36836 ec2-54-243-225-221.:urd CLOSE_WAIT tcp 0 0 ip-10-0-1-75.ec:50903 ec2-54-243-161-229.:urd ESTABLISHED urd is 465 from what I understand. So my instance in the private subnet routes the request to the NAT instance, and the NAT (in public subnet) sends the packets to the remote server. So why is 465 needed inbound anyway? | | Sendmail and Gmail Posted: 14 Jul 2022 08:36 AM PDT I'm trying to send email with sendmail. I followed this how-to: http://linuxconfig.org/configuring-gmail-as-sendmail-email-relay I tried to send the email over console: echo "Just testing my sendmail gmail relay" | mail -v -s "Sendmail gmail Relay - New Server" user@gmailcom The output of command is: WARNING: local host name (server01) is not qualified; see cf/README: WHO AM I? user@gmail.com... Connecting to [127.0.0.1] via relay... 220 server01 ESMTP Sendmail 8.14.4/8.14.4; Thu, 10 Dec 2015 18:05:36 -0200 >>> EHLO server01 250-server01 Hello server1 [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-DELIVERBY 250 HELP >>> MAIL From:<root@server01> SIZE=279 250 2.1.0 <root@server01>... Sender ok >>> RCPT To:<user@gmail.com> >>> DATA 250 2.1.5 <user@gmail.com>... Recipient ok 354 Enter mail, end with "." on a line by itself >>> . 250 2.0.0 tBAK5aGc015664 Message accepted for delivery user@gmail.com... Sent (tBAK5aGc015664 Message accepted for delivery) Closing connection to [127.0.0.1] >>> QUIT 221 2.0.0 server01 closing connection But the e-mail never arrives. Can you guys help me? Logs: Dec 10 19:03:31 server01 sendmail[16310]: tBAL3Uua016310: from=root, size=279, class=0, nrcpts=1, msgid=<201512102103.tBAL3Uua016310@server01>, relay=root@localhost Dec 10 19:03:31 server01 sendmail[16311]: tBAL3VCu016311: from=<root@server01>, size=524, class=0, nrcpts=1, msgid=<201512102103.tBAL3Uua016310@server01>, proto=ESMTP, daemon=MTA, relay=corp-poa-pabx1 [127.0.0.1] Dec 10 19:03:31 server01 sendmail[16310]: tBAL3Uua016310: to=user@gmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30279, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (tBAL3VCu016311 Message accepted for delivery) Dec 10 19:03:32 server01 sendmail[16313]: STARTTLS=client, relay=gmail-smtp-msa.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128 Dec 10 19:03:33 server01 sendmail[16313]: tBAL3VCu016311: to=<user@gmail.com>, ctladdr=<root@server01> (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=120524, relay=gmail-smtp-msa.l.google.com. [64.233.190.108], dsn=5.0.0, stat=Service unavailable Dec 10 19:03:33 server01 sendmail[16313]: tBAL3VCu016311: tBAL3XCu016313: DSN: Service unavailable Dec 10 19:03:33 server01 sendmail[16313]: tBAL3XCu016313: to=<root@server01>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31757, dsn=2.0.0, stat=Sent Thanks in advance.. | | Unable to bind OSX 10.9 to Active Directory 2008 Posted: 14 Jul 2022 09:00 AM PDT I am struggling to bind OSX 10.9 to a 2008 r2 Active Directory. I can join the domain fine when I boot into Windows from the same machine. From OSX I can find the domain controller successfully and have verified consistency of Active Directory service records (using dig -t SRV _service._tcp.fqdn.example.com to check _ldap, _kerberos, _kpasswd or _gc) but I cannot bind to the domain. I am attempting to join a small network with only one DC. I receive the message: "Authentication Sever could not be contacted. (5200)" This is the case whatever method I attempt to use (Join from the Users and Groups pref pane, Bind from the Open Directory utility, using dsconfigad from terminal). I don't think it is a problem with system time as the time on the client and DC are the same. Any other suggestions as to the problem or direction as to what to look out for in the log files? | | kvm guest can not connect to outside of host, vice versa Posted: 14 Jul 2022 09:00 AM PDT I have a vmware vm running ubuntu 12.04 server(name=vmhost), with network bridged and full access to the internet. This vmhost is using the kvm hypervisor and is running a vm(centOS 6.4),network bridged as well. The vmhost can access internet and can also access its vm, and the vm can access the vmhost. The vm cannot access the internet, nor can I ping/ssh into it from another pc on my subnet. I have a bridge for the vmhost/its vm and have checked the iptables/routes but haven't found anything. Also I have ip_forwarding. Running tcpdump I see that vmhost can see the packages but does nothing with them. I have also tried disabling the ufw but didn't help. Infor for VHMOST route: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.0.1 0.0.0.0 UG 100 0 0 virbr0 192.168.0.0 * 255.255.255.0 U 0 0 0 virbr0 The vmhouste Iptables -l Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT udp -- anywhere anywhere udp dpt:domain ACCEPT tcp -- anywhere anywhere tcp dpt:domain ACCEPT udp -- anywhere anywhere udp dpt:bootps ACCEPT tcp -- anywhere anywhere tcp dpt:bootps Chain FORWARD (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere 192.168.122.0/24 state RELATED,ESTABLISHED ACCEPT all -- 192.168.122.0/24 anywhere ACCEPT all -- anywhere anywhere REJECT all -- anywhere anywhere reject-with icmp-port-unreachable REJECT all -- anywhere anywhere reject-with icmp-port-unreachable Chain OUTPUT (policy ACCEPT) target prot opt source destination Interface file: auto lo iface lo inet loopback auto virbr0 iface virbr0 inet static address 192.168.0.21 network 192.168.0.0 netmask 255.255.255.0 broadcast 192.168.0.255 gateway 192.168.0.1 dns-nameservers 192.168.0.1 bridge_ports eth0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off Brctl show: bridge name bridge id STP enabled interfaces virbr0 8000.000c29f8f8e4 yes eth0 vnet1 vnet0 8000.000000000000 no THE VM ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 02:00:c0:a8:00:20 brd ff:ff:ff:ff:ff:ff inet 192.168.0.32/24 brd 192.168.0.255 scope global eth0 inet6 fe80::c0ff:fea8:20/64 scope link valid_lft forever preferred_lft forever ip route 192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.32 default via 192.168.0.1 dev eth0 I will post tcpdump results shortly. It is also worth mentioning that I am running opennebula with vmhost as my vm host, but I don't think this is the problem. | | Mount network drive as physical drive Posted: 14 Jul 2022 08:43 AM PDT Is there a way to mount a network location so that it appears as a local physical disk? e.g. \\computer\share as D: (not a network drive) | |
| OSCHINA 社区最新专区文章 Posted: 14 Jul 2022 10:01 AM PDT | 云计算和开源时代,数据库团队的地位上升了还是下降了? Posted: 14 Jul 2022 04:13 AM PDT 文章来源:微信公众号 "信息化与数字化" 作者:沈旸 作为企业的科技战略决策者,如何看待数据库在企业数字化转型策略中的定位? 最近十几年,数据库领域发生了非常大的变化,尤其是有了云计算和分布式数据库以后。在2012年之前,市场上流行的大多数是商业数据库,例如Oracle,Microsoft SQL Server,IBM DB2,这三大数... | | 绝了!深度解析了1道华为Python笔试题,竟然可以学会12种Python里正则表达式的用法 Posted: 13 Jul 2022 10:04 AM PDT  大家好,这里是程序员晚枫。 今天用一道华为笔试题,带大家深入掌握一项Python技巧:正则表达式。 >本文主要分为4个部分:题目解析、常用方法、专业方法、注意事项 ## 一、题目解析 先来看一下题目。  课件获... | | AI标准化引擎在Pink客户端实践与思考 Posted: 12 Jul 2022 08:02 PM PDT 原创 Jeffrey 得物技术 一、背景 AI在目前互联网可以说早已渗入各个业务。搜索、预测、图像识别、语音识别等等早已应用较为成功。 得物被广大年轻消费者熟知的一个原因是其强大的质量与正品保障体系,而为此背后需要的是得物供应链体系艰辛的付出。 算法推出模型中台解决方案,来辅助人工做瑕疵检测与一致性识别。同时需... | |
| OSCHINA 社区最新专区文章 Posted: 14 Jul 2022 06:10 AM PDT | 字节跳动加入 OSPO 群聊, 将投入超十人全职团队 Posted: 12 Jul 2022 02:01 AM PDT 2022 年 5 月,字节跳动官宣成立开源委员会,这一举动在业界的意料之中。 一方面,开源来势汹汹,正在席卷整个软件行业;另一方面,2021 年字节团队接连出现与开源相关的合规性事件。作为近年来在世界范围内都风头正盛的互联网大厂,字节跳动迎来了必须规范和重视开源的重要节点。 由此,开源中国编辑部请到了字节跳动开... | | 如何参与开源项目 - 细说 GitHub 上的 PR 全过程 Posted: 12 Jul 2022 07:17 PM PDT ## 一、概述 **今天我准备和你详细介绍如何开始参与开源项目,帮助你在 GitHub 上完成第一个 PR 的合入**。 当然,除了正常的 PR 合入流程之外,我还准备详细介绍一下如果一个 PR 提交后遇到了冲突、需要追加 commits、需要合并 commits 等等相对复杂问题该如何解决。 总的来说,本文计划分为4个部分: 1. 谈谈为什么要参... | | 开源办公室(OSPO)大揭秘 Posted: 12 Jul 2022 12:03 AM PDT 近年来,国内互联网大厂相继设立开源办公室(Open Source Program Office,简称 OSPO),其中有部 分企业在 OSPO 建设方面更是颇有成效。虽说 OSPO 并不是什么新鲜事物,但却少有人揭开其神秘面纱, 因此它常常为外界所误解,甚至有人说是形同虚设,其存在是浪费资源。因此,开源中国邀请了四位业内专家, 来谈一谈真实的... | | 心寄开源,合规护航!2022开放原子全球开源峰会开源合规分论坛即将开幕 Posted: 11 Jul 2022 11:49 PM PDT 《国民经济和社会发展第十四个五年规划和 2035 年远景目标纲要》中提到:"支持数字技术开源社区等创新联合体发展,完善开源知识产权和法律体系,鼓励企业开放软件源代码、硬件设计和应用服务"。 研究表明,近年全球企业所使用的软件中开源软件占比已高达 90%,我国从开源战略布局到开源生态发展均势头迅猛,开源在推动... | |
| Recent Questions - Stack Overflow Posted: 14 Jul 2022 01:51 AM PDT | Uncaught Error: Maximum update depth exceeded error with useState() Posted: 11 Jul 2022 04:05 AM PDT Why am I getting this error? Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops. This is my code: const [roles, setRoles] = useState([]); useLayoutEffect(() => { setRoles(["5nxg5wvb"]); }); Note that the same error appears when I use useEffect, and that error only goes away when I change the code to this: useLayoutEffect(() => { setRoles("5nxg5wvb"); }); Any help would be appreciated... | | Whatsapp Cloud API - An unknown error occurred Posted: 11 Jul 2022 04:05 AM PDT I recently started using the new Whatsapp Cloud API. Unfortunately already the sample request in the first steps guide gives an error message. The request to the messages endpoint gives the following response: { "error": { "message": "An unknown error occurred", "type": "OAuthException", "code": 1, "error_subcode": 2593006, "is_transient": false, "error_user_title": "Account Not Exist", "error_user_msg": "Account does not exist in Facebook Hosted API, please use /register API to create an account first.", "fbtrace_id": "AX1Thf9OPBhmj7NlDV6-5IA " } } I am still using the Test WhatsApp Business Account with a Test Number. When calling the register endpoint I get You can't complete the setup process because your business doesn't meet WhatsApp's policy requirements. If you think this is incorrect, reach out to Meta Business Suite support for help. Does anyone have an idea, what the problem is? Thank you in advance, Sören | | Should I expect a client to authenticate before trying to make a request? Posted: 11 Jul 2022 04:05 AM PDT I've just integrated application insights into an application, and what is clear is that we are getting a lot of 401 error messages against an api layer. Looking at the way the sample code is written, its clear that it tries to call the service without even attempting to authenticate first, then uses the 401 to redirect to the login page, where it authenticates before reattempting the original request. Whilst is works, My question is, "Is this reasonable, and should I expect callers to authenticate before calling an endpoint"? from my perspective, it makes debugging distributed calls very difficult. The service architecture is overly chatty, and this makes it even more difficult to actually follow the callstack | | Display Form data on popup\modal when submitted in Angular Posted: 11 Jul 2022 04:04 AM PDT I have a form with submit button. On clicking the submit button, popup\modal should appear displaying the data of the form submitted. I am using Bootstrap and Angular. Please help in this. | | How to convert string to json and vice versa in flutter? Posted: 11 Jul 2022 04:04 AM PDT Hi below is the json that I need to extract data from. [ "http://activepeersai.computing.dcu.ie/feedback_participant/114", "http://activepeersai.computing.dcu.ie/peerLearningPrompter/4", "{\"0\":{\"feedback_id\":114,\"timer_used\":1,\"timer\":10.0,\"question1\":\"How to break ice with strangers (in social gathering & in formal events) ?\",\"question2\":\"How to build networking (with those from different age, culture, education background, language\\u2026)(in university & in workplace) ?\",\"question3\":\"\",\"question4\":\"\",\"question5\":\"\",\"question6\":\"\",\"question7\":\"\",\"question8\":\"\",\"question9\":\"\",\"question10\":\"\"},\"1\":{\"feedback_id\":115,\"timer_used\":1,\"timer\":10.0,\"question1\":\"How to deal with difficult teammates (dominating \\/ debater character \\/ negative \\/ lack of confidence \\/ free rider\\u2026) ?\",\"question2\":\"How to build mutual trust with teammates ?\",\"question3\":\"\",\"question4\":\"\",\"question5\":\"\",\"question6\":\"\",\"question7\":\"\",\"question8\":\"\",\"question9\":\"\",\"question10\":\"\"}}", "{\"id\":{\"0\":1,\"1\":2,\"2\":3,\"3\":4,\"4\":5,\"5\":6,\"6\":7,\"7\":8,\"8\":9,\"9\":10,\"10\":11,\"11\":12,\"12\":13,\"13\":14,\"14\":15,\"15\":16,\"16\":17,\"17\":18,\"18\":19,\"19\":20,\"20\":21,\"21\":22,\"22\":23,\"23\":24,\"24\":25,\"25\":26,\"26\":27,\"27\":28,\"28\":29,\"29\":30,\"30\":31,\"31\":32,\"32\":33,\"33\":34,\"34\":35,\"35\":40,\"36\":41,\"37\":42,\"38\":43,\"39\":44,\"40\":45,\"41\":46,\"42\":47,\"43\":48,\"44\":49,\"45\":50,\"46\":51,\"47\":52,\"48\":53,\"49\":54,\"50\":55,\"51\":56,\"52\":57,\"53\":58,\"54\":59,\"55\":60,\"56\":61,\"57\":62,\"58\":63,\"59\":36,\"60\":37,\"61\":38,\"62\":39},\"name\":{\"0\":\"Why did the sharer choose this skill as the most confident skill and why did the learner wants to improve this skill?\",\"1\":\"Can you share another situation whereby using this skill made a very big difference to the outcome? What did you do? What was the result? What might have happened if this skill wasn't brought to the situation?\",\"2\":\"What advice do you have to give to others about becoming better at using this skill in their work and in their lives generally?\",\"3\":\"What can hold people back from being better at this skill? How can you encourage them to overcome these challenges?\",\"4\":\"What would be the outcome if this session\\/series was a huge success? How would we know if this happened?\",\"5\":\"What is working for you now? What is stopping you from moving forward?\",\"6\":\"What do your role models do that you would love to learn\\/incorporate as habits\\/adopt as a mindset?\",\"7\":\"\\\"What got you here won't get you there.\\\" What is your reaction to that statement? What actions have got you to this point that may not serve you if you move forward? What new behaviours do you need to adopt?\",\"8\":\"What would be the outcome if this session\\/series was a huge success? How would we know if this happened?\",\"9\":\"If you had all the time, people, money, resources that you might possibly need, what would you do differently? Does that energise you, frighten you or a bit of both?\",\"10\":\"What do you think you need to do get a better result (or closer to your goal)?\",\"11\":\"What is the worst that could happen and how could you handle it? What is the best that could happen and how could you handle it?\",\"12\":\"What have been the most impactful decisions that you've made in your career? What led to making those decisions? Were you aware of the impact those decisions would have? What would you say to others in a similar position?\",\"13\":\"What habits have stood you in good stead? Are there things that you do regularly, daily or very often that have made a big different over time?\",\"14\":\"Can you share an experience that was transformational for you, taught you a long-lasting lesson or was particularly memorable for its benefits and challenges?\",\"15\":\"How do you think experience affects somebody's perspective, way of making decisions or their feelings about taking risks?\",\"16\":\"Can you describe your target market for your business or who might your ideal employer be?\",\"17\":\"Can you share details of a project that you worked on recently? Why were you or your business chosen to work with this client\\/employer? What were the success and challenges along the way?\",\"18\":\"What makes you\\/your product\\/your service different to others? Why would a client or employer choose what you do over others?\",\"19\":\"What might I be able to do to help you?\",\"20\":\"What is the key problem that you are facing currently?\",\"21\":\"If that problem was solved, what impact would it have?\",\"22\":\"In order to get to that outcome, what do we need to do, what resources need to be invested and any other changes to be made?\",\"23\":\"Is there a willingness to take that action to get towards that outcome?\",\"24\":\"What assumptions are being made? How likely are each one to happen? What would be the impact of those assumptions happening or not happening?\",\"25\":\"What application of the SCAMPER technique could be useful to help get another perspective?\\n*SCAMPER is an acronym formed from the abbreviation of: Substitute, Combine, Adapt, Modify (Also magnify and minify), Put to another use, Eliminate and Reverse.\",\"26\":\"If we had double the budget, half the time and were living in another country trying to make this happen, how might we think differently?\",\"27\":\"If any idea generated already in this discussion was to become a reality, what would be the impact on e year later in terms of benefits, ongoing coasts, sustained behavioural change and a launchpad for further growth?\",\"28\":\"Leadership\",\"29\":\"Communication\",\"30\":\"Adaptability\",\"31\":\"Team Work\",\"32\":\"Problem Solving\",\"33\":\"Conflict Management\",\"34\":\"Productivity\",\"35\":\"How would you describe good\\/effective communication? Please share an example of a time that you've seen it in action and an example of when you saw that good communication skills were clearly lacking.\",\"36\":\"How have you handled working under someone you felt was not good at communicating?\",\"37\":\"If you're trying to get your point across or convince somebody that your idea is the right one, what do you do?\",\"38\":\"Who do you think is a good communicator and why? What can we learn from them?\",\"39\":\"Talk about a time that you needed to adapt to a new situation. What did you find difficult and how did you work through that? How can somebody prepare to be more adaptable in future situations?\",\"40\":\"When you're in a situation where it feels like you have no control over it (i.e. a new manager, starting in a new job, government-led changes etc), what do you do to focus on what you can do?\",\"41\":\"How do you handle having multiple priorities at the same time?\",\"42\":\"How do you adjust to different work settings? For example, working with different teams, switching between logic and creativity, learning new processes, tools or technologies?\",\"43\":\"How do you feel about working in a team? What do you think are the key things that need to happen to make good teamwork?\",\"44\":\"What has been your experience of working in teams where there were problems? Did these arise due to strong personalities, somebody not sharing the workload, miscommunication, the wrong support or technology systems etc?\",\"45\":\"How do you keep a team motivated? Share your story about a rewarding team experience.\",\"46\":\"When you're in a team situation, what role do you usually play?\",\"47\":\"Describe a situation where you had to solve a problem. What did you do? what was the result? What might you have done differently?\",\"48\":\"What steps do you take before making a decision on how to solve a problem, and why?\",\"49\":\"Give an example of a situation in which you saw an opportunity in a potential problem. What did you do? What was the outcome?\",\"50\":\"Can you tell me about a situation where you overcame a problem using a creative solution?\",\"51\":\"Have you ever had a team member who kept raising objections on projects? How did you (or would you) manage them?\",\"52\":\"You have noticed that a team member is aggressive or arrogant toward the rest of the team. How would you approach this person?\",\"53\":\"What would you do if your manager gave you negative feedback on the way you approached a problem? How do give negative\\/constructive feedback to others?\",\"54\":\"How could you use a situation with conflict to have a better relationship with all involved?\",\"55\":\"How would you describe a typical working day in your current role? How you manage importance versus urgency? How do you maintain a work-life balance also?\",\"56\":\"If you have your day planned out to achieve a goal, how do you manage distractions or other things that can happen along the way?\",\"57\":\"What do you think very productive people do differently than others?\",\"58\":\"What holds people back from being more productive? How can people turn those around so that by doing the opposite, they can become more productive?\",\"59\":\"Have you ever had a team member who kept raising objections on projects? How did you (or would you) manage them?\",\"60\":\"How do you describe your leadership style?\",\"61\":\"What was a difficult decision you had to make as a leader, and how did you come to that decision?\",\"62\":\"What are the most important attributes of successful leaders today? Who do you think is a good leader and why?\"},\"session_type_id\":{\"0\":1.0,\"1\":1.0,\"2\":1.0,\"3\":1.0,\"4\":2.0,\"5\":2.0,\"6\":2.0,\"7\":2.0,\"8\":3.0,\"9\":3.0,\"10\":3.0,\"11\":3.0,\"12\":4.0,\"13\":4.0,\"14\":4.0,\"15\":4.0,\"16\":5.0,\"17\":5.0,\"18\":5.0,\"19\":5.0,\"20\":6.0,\"21\":6.0,\"22\":6.0,\"23\":6.0,\"24\":7.0,\"25\":7.0,\"26\":7.0,\"27\":7.0,\"28\":8.0,\"29\":8.0,\"30\":8.0,\"31\":8.0,\"32\":8.0,\"33\":8.0,\"34\":8.0,\"35\":null,\"36\":null,\"37\":null,\"38\":null,\"39\":null,\"40\":null,\"41\":null,\"42\":null,\"43\":null,\"44\":null,\"45\":null,\"46\":null,\"47\":null,\"48\":null,\"49\":null,\"50\":null,\"51\":null,\"52\":null,\"53\":null,\"54\":null,\"55\":null,\"56\":null,\"57\":null,\"58\":null,\"59\":null,\"60\":null,\"61\":null,\"62\":null},\"session_type_name\":{\"0\":\"Learning and Development\",\"1\":\"Learning and Development\",\"2\":\"Learning and Development\",\"3\":\"Learning and Development\",\"4\":\"Mentoring\",\"5\":\"Mentoring\",\"6\":\"Mentoring\",\"7\":\"Mentoring\",\"8\":\"Coaching\",\"9\":\"Coaching\",\"10\":\"Coaching\",\"11\":\"Coaching\",\"12\":\"Experience Sharing\",\"13\":\"Experience Sharing\",\"14\":\"Experience Sharing\",\"15\":\"Experience Sharing\",\"16\":\"Networking\",\"17\":\"Networking\",\"18\":\"Networking\",\"19\":\"Networking\",\"20\":\"Establishing Buy-In\",\"21\":\"Establishing Buy-In\",\"22\":\"Establishing Buy-In\",\"23\":\"Establishing Buy-In\",\"24\":\"Idea Exploration\",\"25\":\"Idea Exploration\",\"26\":\"Idea Exploration\",\"27\":\"Idea Exploration\",\"28\":\"Seven Soft Skills\",\"29\":\"Seven Soft Skills\",\"30\":\"Seven Soft Skills\",\"31\":\"Seven Soft Skills\",\"32\":\"Seven Soft Skills\",\"33\":\"Seven Soft Skills\",\"34\":\"Seven Soft Skills\",\"35\":null,\"36\":null,\"37\":null,\"38\":null,\"39\":null,\"40\":null,\"41\":null,\"42\":null,\"43\":null,\"44\":null,\"45\":null,\"46\":null,\"47\":null,\"48\":null,\"49\":null,\"50\":null,\"51\":null,\"52\":null,\"53\":null,\"54\":null,\"55\":null,\"56\":null,\"57\":null,\"58\":null,\"59\":null,\"60\":null,\"61\":null,\"62\":null},\"parent_id\":{\"0\":null,\"1\":null,\"2\":null,\"3\":null,\"4\":null,\"5\":null,\"6\":null,\"7\":null,\"8\":null,\"9\":null,\"10\":null,\"11\":null,\"12\":null,\"13\":null,\"14\":null,\"15\":null,\"16\":null,\"17\":null,\"18\":null,\"19\":null,\"20\":null,\"21\":null,\"22\":null,\"23\":null,\"24\":null,\"25\":null,\"26\":null,\"27\":null,\"28\":null,\"29\":null,\"30\":null,\"31\":null,\"32\":null,\"33\":null,\"34\":null,\"35\":30.0,\"36\":30.0,\"37\":30.0,\"38\":30.0,\"39\":31.0,\"40\":31.0,\"41\":31.0,\"42\":31.0,\"43\":32.0,\"44\":32.0,\"45\":32.0,\"46\":32.0,\"47\":33.0,\"48\":33.0,\"49\":33.0,\"50\":33.0,\"51\":34.0,\"52\":34.0,\"53\":34.0,\"54\":34.0,\"55\":35.0,\"56\":35.0,\"57\":35.0,\"58\":35.0,\"59\":29.0,\"60\":29.0,\"61\":29.0,\"62\":29.0}}" ] I need to extract data from the 3rd line. The below code tries to extract the first set of questions from the 3rd line. import 'dart:core'; import 'dart:convert'; import 'package:http/http.dart' as http; class Question { late final String question; Question({ required this.question}); } void getData() async{ List<Question> sample_data = []; String link = 'https://activepeersai.computing.dcu.ie/API/631'; var url = Uri.parse(link); var result = await http .get(url,headers: {"Accept": "application/json","Access-Control_Allow_Origin": "*"}); if(result.statusCode==200){ var data = jsonDecode(result.body); var res = jsonDecode(data[2]); String round1 = json.encode(res); var data1 = jsonDecode(round1); var questions = jsonDecode(data1[0]); for(var k in questions.keys){ if(((k=='question1')|| (k=='question2') || (k=='question3') || (k=='question4') || (k=='question5') || (k=='question6') || (k=='question7') || (k=='question8') || (k=='question9') || (k=='question10'))){ Question question = Question(question: res[k]); sample_data.add(question); } } print('$sample_data'); } } void main() { getData(); } Now when I print round1 I get the below output. {"0":{"feedback_id":114,"timer_used":1,"timer":10,"question1":"How to break ice with strangers (in social gathering & in formal events) ?","question2":"How to build networking (with those from different age, culture, education background, language…)(in university & in workplace) ?","question3":"","question4":"","question5":"","question6":"","question7":"","question8":"","question9":"","question10":""},"1":{"feedback_id":115,"timer_used":1,"timer":10,"question1":"How to deal with difficult teammates (dominating / debater character / negative / lack of confidence / free rider…) ?","question2":"How to build mutual trust with teammates ?","question3":"","question4":"","question5":"","question6":"","question7":"","question8":"","question9":"","question10":""}} Which when I checked on Json Checker came to be valid. But after this I get an error. Error: Expected a value of type 'String', but got one of type 'Null' at Object.throw_ [as throw] (http://localhost:56003/dart_sdk.js:5080:11) at Object.castError (http://localhost:56003/dart_sdk.js:5039:15) at Object.cast [as as] (http://localhost:56003/dart_sdk.js:5356:17) at String.as (http://localhost:56003/dart_sdk.js:46240:19) at getData (http://localhost:56003/packages/testing_for_data/main.dart.lib.js:74:56) at getData.next (<anonymous>) at http://localhost:56003/dart_sdk.js:40641:33 at _RootZone.runUnary (http://localhost:56003/dart_sdk.js:40511:59) at _FutureListener.thenAwait.handleValue (http://localhost:56003/dart_sdk.js:35438:29) at handleValueCallback (http://localhost:56003/dart_sdk.js:35999:49) at _Future._propagateToListeners (http://localhost:56003/dart_sdk.js:36037:17) at [_completeWithValue] (http://localhost:56003/dart_sdk.js:35872:23) at async._AsyncCallbackEntry.new.callback (http://localhost:56003/dart_sdk.js:35906:35) at Object._microtaskLoop (http://localhost:56003/dart_sdk.js:40778:13) at _startMicrotaskLoop (http://localhost:56003/dart_sdk.js:40784:13) at http://localhost:56003/dart_sdk.js:36261:9 Can someone tell me what I am doing wrong? Its coming due to the line var data1 = jsonDecode(round1); | | Property 'children' is missing in type 'Element' but required in type 'ReactPortal Posted: 11 Jul 2022 04:04 AM PDT I tring to setup styled-components for my new project but i get this typescript error. Type 'Element' is not assignable to type 'ReactNode'.\n Property 'children' is missing in type 'Element' but required in type 'ReactPortal'. import { render, Fragment } from "preact"; import { ThemeProvider } from "styled-components/macro"; import { App } from "./app"; import { GlobalStyle, theme } from "./styled"; render( <Fragment> <GlobalStyle /> <ThemeProvider theme={theme}> <App /> </ThemeProvider> </Fragment>, document.getElementById("app")! ); This is my App file import { h } from "preact"; export const App = () => { return <div>setup</div>; }; | | i have problem with PHP substring extraction [duplicate] Posted: 11 Jul 2022 04:05 AM PDT i want to get string "29" after "ตอนที่" from "ตอนที่ 29" i try $data = "ตอนที่ 29"; $whatIWant = substr($data, strpos($data, "ตอนที่") + 1); echo $whatIWant; But output (SS https://prnt.sc/yK7A-TWjlAbq) ��อนที่ 29 how should i fix it? i need only 29 | | Assigning a value to a JavaScript matrix inside of a forEach gone wrong Posted: 11 Jul 2022 04:05 AM PDT The bitGraph.dfs() function returns an array of strings, with a format of 'i,j'. The matrix ends up with columns of ones and zeros. The goal is to have the indexes parsed from the strings of the matrix assigned to ones. I checked the debugger and the line result[x][y] = 1 doesn't execute with each forEach iteration, but instead assigns a 1 to each element of the y column of the matrix at the end of the forEach. const result = Array(N).fill(Array(M).fill(0)); Inside of a for loop: bitGraph.dfs(`${N - 1},${j}`, visited) .forEach(node => { const [x, y] = node.split(',') .map(index => Number(index)); result[x][y] = 1; }); Example: returned array: ['5,0', '4,0', '1,5', '1,4', '1,3'] result: [ [ 1, 0, 0, 1, 1, 1 ], [ 1, 0, 0, 1, 1, 1 ], [ 1, 0, 0, 1, 1, 1 ], [ 1, 0, 0, 1, 1, 1 ], [ 1, 0, 0, 1, 1, 1 ], [ 1, 0, 0, 1, 1, 1 ] ] | | Implement horizontal recyclerview like instagram story effect listing Posted: 11 Jul 2022 04:04 AM PDT | | TypeError: Cannot read properties of undefined (reading 'split') - NextJS Posted: 11 Jul 2022 04:05 AM PDT I was doing some changes in my index.js (nothing split related that I know) file in my NextJS app and after npm run dev, I got the following error: Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'split') Call Stack ../../node_modules/.pnpm/undici@5.5.1/node_modules/undici/lib/core/request.js webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (17232:45) __require webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (16:50) ../../node_modules/.pnpm/undici@5.5.1/node_modules/undici/lib/client.js webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (18044:19) __require webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (16:50) ../../node_modules/.pnpm/undici@5.5.1/node_modules/undici/lib/pool.js webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (19367:18) __require webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (16:50) ../../node_modules/.pnpm/undici@5.5.1/node_modules/undici/lib/agent.js webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (19476:16) __require webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (16:50) src/polyfills/undici.js webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (19607:17) __require webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (16:50) addPrimitives webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (21753:18) eval webpack-internal:///./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js (21855:19) ./node_modules/next/dist/compiled/@edge-runtime/primitives/index.js file:///Users/dusankovacevic/Desktop/buksna/next/core/.next/static/chunks/pages/index.js (14475:1) options.factory /_next/static/chunks/webpack.js (661:31) __webpack_require__ file:///Users/dusankovacevic/Desktop/buksna/next/core/.next/static/chunks/webpack.js (37:33) fn /_next/static/chunks/webpack.js (316:21) eval webpack-internal:///./node_modules/next/dist/server/node-polyfill-web-streams.js (2:42) ./node_modules/next/dist/server/node-polyfill-web-streams.js file:///Users/dusankovacevic/Desktop/buksna/next/core/.next/static/chunks/pages/index.js (15152:1) options.factory /_next/static/chunks/webpack.js (661:31) __webpack_require__ file:///Users/dusankovacevic/Desktop/buksna/next/core/.next/static/chunks/webpack.js (37:33) fn /_next/static/chunks/webpack.js (316:21) eval webpack-internal:///./node_modules/next/dist/server/render.js (47:5) ./node_modules/next/dist/server/render.js file:///Users/dusankovacevic/Desktop/buksna/next/core/.next/static/chunks/pages/index.js (15207:1) options.factory /_next/static/chunks/webpack.js (661:31) __webpack_require__ file:///Users/dusankovacevic/Desktop/buksna/next/core/.next/static/chunks/webpack.js (37:33) fn /_next/static/chunks/webpack.js (316:21) eval webpack-internal:///./pages/index.js (8:81) ./pages/index.js file:///Users/dusankovacevic/Desktop/buksna/next/core/.next/static/chunks/pages/index.js (14584:1) options.factory /_next/static/chunks/webpack.js (661:31) __webpack_require__ file:///Users/dusankovacevic/Desktop/buksna/next/core/.next/static/chunks/webpack.js (37:33) fn /_next/static/chunks/webpack.js (316:21) eval webpack-internal:///./node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js (5:16) eval webpack-internal:///./node_modules/next/dist/client/route-loader.js (211:24) Any help is appreciated. I am stuck here for a while now, not able to find a solution. As stated, I haven't changed/added anything related to slice while committing the changes :) | | Server response when user was authenticated Posted: 11 Jul 2022 04:04 AM PDT I am poking around client-server communication, and I am stuck on a problem, where I don't know what the server should respond with, when the user authentication has been successful, or not. Do I want to respond with just a "True" or "False", or are there more intricate responses when designing a server? | | Unable to access field that has hyphen in it Posted: 11 Jul 2022 04:05 AM PDT I am struggling to write a firebase rule that is checking the user id that is stored in a document. Hardcoding a given value as a string works allow write: if request.auth.uid == 'user-id-hardcoded'; ,however I am unable to find a way to dynamically address it. I am left with the impression it's due to the hyphen in the document field after checking this question - Firebase security rules : How can I use dashes or hyphen in paths?. I also tried to substitute user-id with userId to no avail. allow write: if request.auth.uid == resource.data.user-id; Any help will be appreciated. | | File size check, Linux Posted: 11 Jul 2022 04:04 AM PDT File size check file_path="/home/d-vm/" cd $file_path # file_path directory file=($(cat video.txt | xargs ls -lah | awk '{ print $9}')) # get name in video.txt --- two files for example VID_141523.mp4 VID_2_141523.mp4 minimumsize=1 actualsize=$(wc -c <"$file") if [ $actualsize -ge $minimumsize ]; then echo $file size $actualsize bytes else echo error $file size 0 bytes fi VID_141523.mp4 file corrupted during conversion. its size 0 bytes Script output---- error VID_20220709_141523.mp4 size 0 bytes video.txt - VID_141523.mp4
- VID_2_141523.mp4
How to add this construct to the loop ? It should check all files in the list video.txt | | Returning IEnumerable with an anonymous type Posted: 11 Jul 2022 04:05 AM PDT I have an interface similar to this: IEnumerable<(string valueA, decimal valueB)> GetData This interface should not be changed. So I'm trying to implement it. I need to use LINQ, so I have this part of code: var fetchedData = File.ReadAllLines(filePath) .Skip(1) .Select(a => x.Split(';')) .Select(a => new { valueB= decimal.Parse(a[0]), valueA= a[1] }); return fetchedData; The problem is that fetchedData is not of the same type the interface expects. I need to return IEnumerable<(string valueA, decimal valueB)> but fetchedData is another type. | | python duplicate values and key in multiple dictionary rearrange into single dictionary Posted: 11 Jul 2022 04:04 AM PDT i have a list of dict like this list_1 = [{'id': '123', 'name': {'new': 'kevin'}}, {'id': '123', 'name': {'old': 'alan'}}, {'id': '456', 'name': {'new': 'jason'}}, {'id': '456', 'name': {'old': 'jack'}}] But I want to merge the same values together using something function The desired output is as follows list_1 = somethingfunction() output: {'id': '123', 'name': {'new': 'kevin','old': 'alan'}} {'id': '456', 'name': {'new': 'jason','old': 'jack'}} Don't know if there is any function that can quickly merge the same values and key together | | .NET variable memory ALLOCATION versus memory USAGE Posted: 11 Jul 2022 04:05 AM PDT This is a relatively simple question, but lately I've been looking into Huffman encoding and wanted to ask the pros here at SO. If I declare a variable as Int32, does it necessarily use all the allocated memory? That is, if my Int32 has a value of 1… Int32 myVar = 1; // binary 00000000 0000000 0000000 00000001 (4 bytes = 32 bits) …then are all 32 bits used, or are they only used as needed when the variables value requires the bits? Seemingly, unless I used a low level language like C, C++, Rust, assembly, then Huffman encoding doesn't provide any compression of my data, albeit perhaps some very basic obfuscation of the original ASCII representation. Please advise. I appreciate you thoughts on this subject. | | How to find and replace 0/0 to 0; 0/1 to 1 and 1/1 to 1, occuring in multiple rows and columns in a big datafile? Posted: 11 Jul 2022 04:04 AM PDT I have a huge input file with several columns (Column10-Column28) that contains either 0/0, 0/1 or 1/1 data entries. I want to find and replace in place the following:- 0/0 to 0; 0/1 to 1; and 1/1 to 1. input file: #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT Sample-1 Sample-2 Sample-3 Sample-4 Sample-5 Sample-7 Sample-8 Sample-9 Sample-10 Sample-11 Sample-12 Sample-13 Sample-14 Sample-15 Sample-16 Sample-17 Sample-18 Sample-19 Sample-20 Sample-21 Sample-22 Sample-23 Sample-24 Sample-25 Sample-27 Sample-28 Sample-29 Sample-30 chr10 60074 . G C . PASS ADP=10;HET=1;HOM=0;NC=0;SF=1;WT=0;AN=25;AC=0 GT:ADR:RDF:ABQ:DP:FREQ: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.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/1:.:.:.:.:.:-69.4469,0,-78.8411:36:.:.:1092:.:.:.:.:29:997:.:69 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/1:.:.:.:.:.:-60.0267,0,-33.0544:15:.:.:491:.:.:.:.:23:799:.:38 0/0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0/1:.:.:.:.:.:-10,0,-10:19:.:.:580:.:.:.:.:18:634:.:37 output file: #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT Sample-1 Sample-2 Sample-3 Sample-4 Sample-5 Sample-7 Sample-8 Sample-9 Sample-10 Sample-11 Sample-12 Sample-13 Sample-14 Sample-15 Sample-16 Sample-17 Sample-18 Sample-19 Sample-20 Sample-21 Sample-22 Sample-23 Sample-24 Sample-25 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.:.:.:.:.:. 1:.:.:.:.:.:-69.4469,0,-78.8411:36:.:.:1092:.:.:.:.:29:997:.:69 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 1:.:.:.:.:.:-60.0267,0,-33.0544:15:.:.:491:.:.:.:.:23:799:.:38 0:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. 1:.:.:.:.:.:-10,0,-10:19:.:.:580:.:.:.:.:18:634:.:37 Can anyone please suggest an easy approach, perhaps awk + gsub command?? | | Is it possible to lappend to a list in a list held in array directly without using a temporary variable? Posted: 11 Jul 2022 04:05 AM PDT In the code below, is there anyway to get the same result without using the temporary variable x? It appears that lappend will not update a list unless held in a variable and I don't know how to get something like [lindex comPorts($sock) 4] versus [lindex $comPorts($sock) 4], which doesn't work because is a value not stored in a variable. Thank you. set sock abc set comPorts($sock) [list $sock 0 0 1 {129} {} {} {} ] set data {134 135} chan puts stdout [lindex $comPorts($sock) 4] # => 129 set x [lindex $comPorts($sock) 4] chan puts stdout [lappend x {*}$data] # => 129 134 135 chan puts stdout [lset comPorts($sock) 4 $x] # => abc 0 0 1 {129 134 135} {} {} {} ] | | Custom Repository Implementation is not being recognized Posted: 11 Jul 2022 04:04 AM PDT I am currently working on a project where I have created the following custom Repository: public interface ServiceRepository<T extends ServiceEntity> extends JpaRepository<T, UUID>, ServiceRepositoryCustom { } public interface ServiceRepositoryCustom { List<ServiceEntity> findAllContainingName(String query); } @Repository("Repo") public class ServiceRepositoryCustomImpl implements ServiceRepositoryCustom { private final EntityManager em; public ServiceRepositoryCustomImpl(EntityManager em) { System.out.println("I got constructed"); this.em = em; } @Override public List<ServiceEntity> findAllContainingName(String name) { System.out.println("I got called with: " + name); CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<ServiceEntity> cq = cb.createQuery(ServiceEntity.class); Root<ServiceEntity> serviceEntity = cq.from(ServiceEntity.class); List<Predicate> predicates = new ArrayList<>(); if(name != null) { // predicates.add(cb.equal(serviceEntity.get("name"), name)); predicates.add(cb.like(serviceEntity.get("name"), name + "%")); } cq.where(predicates.toArray(predicates.toArray(new Predicate[0]))); return em.createQuery(cq).getResultList(); } } The print statement "I got called with: " never gets called. So for whatever reason Spring Boot is not running the method through my custom implementation. Any suggestions? Any help is much appreciated Edit: Here is the code that injects and uses the Repository in question @Repository public interface PineappleServiceRepository extends ServiceRepository<PineappleServiceEntity> { } @Component("Registry") @DependsOn({"Context", "Repo"}) public class Registry { private final List<ServiceRepository<? extends ServiceEntity>> serviceRepositories = new ArrayList<>(); public Registry(PineappleServiceRepository pineappleServiceRepository) { this.serviceRepositories.add(pineappleServiceRepository); } } Edit 2: The code prints "I got constructed" Edit 3: Class where findAllContainingName is called @RestController @RequestMapping("/test") @DependsOn("Registry") public class ServiceController { private final Registry registry; public ServiceController(@NotNull Registry registry) { this.registry = registry; } @GetMapping("") List<ServiceEntity> all(@RequestParam("q") String query) { return getAllServices(query); } private @NotNull List<ServiceEntity> getAllServices(String query) { List<ServiceEntity> response = new ArrayList<>(); for(ServiceRepository<? extends ServiceEntity> repo: this.registry.getServiceRepositories()){ response.addAll(repo.findAllContainingName(query)); } return response; } } Edit 4: Here the entities: @Entity @Table(name = "services") public abstract class ServiceEntity { protected @Id UUID id = UUID.randomUUID(); protected String name; // Constructor + Getters and Setters } @Entity public class PineappleServiceEntity extends ServiceEntity { // Additional Properties, matching Constructors, Getters and Setters } | | SQL: Get the latest value from all rows but ignore nulls Posted: 11 Jul 2022 04:05 AM PDT I'm inserting a new row per order update so I can keep track of the state updates. Like this. +----------+-----------+--------+-----------------------+-----------------------+----------------------------------+ | event_id | state | amount | address | notes | timestamp | +----------+-----------+--------+-----------------------+-----------------------+----------------------------------+ | order123 | fulfilled | NULL | NULL | NULL | 2022-07-01T17:08:12.032316+00:00 | | order123 | NULL | NULL | NULL | Delivered to customer | 2022-07-01T17:07:12.032316+00:00 | | order123 | NULL | NULL | 300 Post St, CA 94108 | NULL | 2022-07-01T17:06:12.032316+00:00 | | order123 | accepted | NULL | NULL | NULL | 2022-07-01T17:05:12.032316+00:00 | | order123 | pending | 100 | NULL | NULL | 2022-07-01T17:04:12.032316+00:00 | +----------+-----------+--------+-----------------------+-----------------------+----------------------------------+ How would I write a query that pulls out the latest value from each of those columns, ignoring the NULLs. This is what I'm looking for. +----------+-----------+--------+-----------------------+-----------------------+----------------------------------+ | event_id | state | amount | address | notes | timestamp | +----------+-----------+--------+-----------------------+-----------------------+----------------------------------+ | order123 | fulfilled | 100 | 300 Post St, CA 94108 | Delivered to customer | 2022-07-01T17:08:12.032316+00:00 | +----------+-----------+--------+-----------------------+-----------------------+----------------------------------+ This is as far as I've gotten, which gives me the latest record: SELECT DISTINCT ON (event_id) event_id, state, amount, address, notes, timestamp FROM event_order ORDER BY event_id, timestamp DESC; DB Fiddle link: https://www.db-fiddle.com/f/pZFUG96oYh6ymAz99vvqWh/0 I came across this post which mentions LAST_VALUE but the solution seems like it only works with integers. Any help will be appreciated. | | Flutter parse unicode characters not working Posted: 11 Jul 2022 04:05 AM PDT I have the following string coming from my backend server \u25CF\u25CF\u25CF and when I decode it with UTF-8 it's working fine in the iOS native app, But when I try to parse it in flutter I'm not able to get the converted value. I have tried the following approaches but none worked String converted = Utf8Decoder().convert(userName.codeUnits); String uname = utf8.decode(userName.runes.toList()); String runes = String.fromCharCodes(Runes('$userName')); Does anyone know how we can fix this? The real value should be 3 dots after conversion. | | CDC using kafka and kafka streams Posted: 11 Jul 2022 04:04 AM PDT I'm trying to sync my postgres to elasticsearch. For this purpose I'm using debezium + kafka connnect, kafka and kafka streams.
For now I'm able to sync the changes perfectly to elasticsearch, including update, delete and create. But what confuses me is if my approach is correct and that if there's any other better way to do this. Here's my approach : - Stream changes for each table (9 in total) from DB to separate kafka topics using debezium + connect.
- In streams application, read those topics as KTable and join them to get complete doc.
- Write the KTable (output of join operation) to another topic and sink it using elastic search sink connector.
The reason I'm reading topic as a KTable is because it could happen that (say) some information regarding a specific record was modified after (say) 24hrs. If I read them as KStream then join operation will be windowed and that could cause issues. For example : Let's say there are 3 tables, product, product_category, categories. Then on initial sync things might work fine. But later on if another category was added for the same product (a new entry in product_category) after 24 hours. There's a possibility that the windowed join will not work if windowed option is set for 1 hr. And I'm not sure how KTable - KTable join works internally, is it efficient and will it scale properly for 8-10 Million records ? Also is it okay to create a new topic for each table ? I'll most probably have to join on all of those tables (9 tables in total). Any advice would be really appreciated :) Let me know if some more information is needed. Thanks :) | | Make .netrc authentication work with aiohttp Posted: 11 Jul 2022 04:05 AM PDT I'd like to use a .netrc file with credentials to authenticate to an API using aiohttp. As far as I can tell this should be possible, as long as the file is in the home directory (or the relevant env variable set correctly) and trust_env=True set in the aiohttp.ClientSession. But whatever I try, I get a 401 response. I've checked with requests, and it works just fine. I've browsed through the relevant code and it seems like it'll only pick up the credentials if a proxy is supplied. Can someone explain? Here's an example that reproduces the issue: First put a .netrc file in home directory: machine httpbin.org login foo password bar import aiohttp import requests url = "http://httpbin.org/basic-auth/foo/bar" with requests.Session() as sess: r = sess.get(url) r.raise_for_status() # no exception raised async with aiohttp.ClientSession(trust_env=True) as session: r = await session.get(url) r.raise_for_status() # exception raised ClientResponseError: 401, message='UNAUTHORIZED', url=URL('http://httpbin.org/basic-auth/foo/bar') | | Can't drag and drop in Ubuntu 22.04 Posted: 11 Jul 2022 04:04 AM PDT It seems like Desktop Icons NG (DING) is not instelled on my desktop. I can't drag and drop items from or in the desktop. When I try to install it manually it says something like: this is an extension enabled by your current mode. Can't be installed. But it is not installed... Even in the setting it is not showing up.  | | Getting CannotPullContainerError on ECS Fargate Posted: 11 Jul 2022 04:05 AM PDT I am trying to run my microservice on ECS Fargate. I have self hosted private Docker registry. I have tried pulling the same Docker image from inside the EC2 server in the same subnet as ECS Fargate service, it's able to pull the Docker image. But, with ECS Fargate, I am getting the following error: CannotPullContainerError: inspect image has been retried 5 time(s): failed to resolve ref "xxxxxxxxxxxxxx/xxxxxxxxxx:latest": failed to do request: Head https://xxxxxxxxxxxxxx/v2/xxxxxxxxxxxxxx/mani.. If it's the networking error, then it should not be accessible from the EC2 server in the same subnet as well. Looks like some issue with Fargate itself. | | how to catch all GenericMotionEvent when a DialogFragment is shown? Posted: 11 Jul 2022 04:04 AM PDT I need to show a preference dialog that wait for Joypad keypress. I know that DialogFragment has its own Window then has its own onKeyListener. I can easily catch Joypad press by setting a listener like that. public class MyDialogFragment extends PreferenceDialogFragmentCompat { @Override protected void onPrepareDialogBuilder(AlertDialog.Builder builder) { super.onPrepareDialogBuilder(builder); builder.setOnKeyListener(new DialogInterface.OnKeyListener() { @Override public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { // do stuff with intercepted key press return true; } }); } } But, I have trouble catching GenericMotionEvents. In order to intercept them, I've overridden onGenericMotionEvents in the Activity class and eventually forward the Event by calling a method on MyDialogFragment class. It works 100% correctly when MyDialogFragment is not shown as when an analog trigger/direction stick is moved, I can get an event. The weird part is that IF MyDialogFragment is shown, then I can get only analog direction stick events BUT NOT left/right analog triggers events. Does someone know why and how to fix this behaviuor? | | How can I display a return in three columns (in Google Apps Script) that looks like an array, but (to me) doesn't behave like one? Posted: 11 Jul 2022 04:04 AM PDT How can I display this return in three columns on my web app, preferably with given headers? (FIGURED IT OUT!) THIS IS PROBABLY IMPORTANT! According to the writer of the gvizQuery function, which I use to find data in a referenced Google Sheet, the return is an array of arrays. Also, I now run V8 of Google Apps Script. So, this is the simplest version of the code where I provide a serial number, which is sent to the query function, and returned along with a reference to ou and most recent user. document.getElementById("btnserno1").addEventListener("click",fetchCBOU); function fetchCBOU(){ var sernum = document.getElementById("serial").value; google.script.run .withSuccessHandler(printCBOUU) .queryCBOU(sernum); } window.printCBOUU = function(CBOUU) { console.log(CBOUU); var CBOU1 = CBOUU document.getElementById('idCB').innerHTML = CBOU1[0]; document.getElementById('idCBOU').innerHTML = CBOU1[1]; document.getElementById('idCBRecent').innerHTML = CBOU1[2]; } In the Stackdriver logs the return is displayed like this. Feb 17, 2020, 12:07:22 AM Info [[[5CD725B5B0, /Grundskolor/Boras, utd8377@edu.kunskapsskolan.se]]] This is what it looks like in the console. First a perfect match.  On the web app it displays the three values in one place, and leaves the other two as undefined.  If I instead do a partial match, I get more arrays in console.  But in the web app I get all those values in the first element and the two other elements are still undefined. If I manipulate the incoming data after it arrives, and try split it up, I get different results depending on if it's a perfect or partial match. I change the middle part of the code to this. window.printCBOUU = function(CBOUU) { console.log(CBOUU); //Creating the new variable, based off CBOUU, adding quotation marks. var str = CBOUU + ''; console.log(str); //Creating the new array, based off CBOUU, and now, since it has quotation marks, it becomes an array. var CBOU1 = str.split(","); console.log(CBOU1); document.getElementById('idCB').innerHTML = CBOU1[0]; document.getElementById('idCBOU').innerHTML = CBOU1[1]; document.getElementById('idCBRecent').innerHTML = CBOU1[2]; } For a perfect match and a partial match that only has a single matching device everything still works.  But if I do a partial match and get many hits everything breaks, as it is no longer working with variables with three sets of data, but instead as many values as there are matching devices, times three values. And to display them I'd have to keep adding CBOU1[n] values for each one.  Do note that this is not static data! I'm trying to display the return from a function where I search for a partial serial number from a Google sheet. Logs (I thought this was an array, with three values for each object, but apparently this could be an array of arrays) [20-02-14 16:28:16:153 CET] [[[5CD9264KBW, /Grundskolor/Boras, user1@my.domain], [5CD9264K64, /Grundskolor/Boras, user2@my.domain], [5CD9264K7V, /Grundskolor/Boras, user3@my.domain], [5CD9264K6M, /Grundskolor/Boras, user4@my.domain]] Console after I try to turn it into a usable array (here it looks to me to be a single array of only one object, with a bunch of values) ["5CD9264KBW", "/Grundskolor/Boras", "user1@my.domain", "5CD9264K64", "/Grundskolor/Boras", "user2@my.domain", "5CD9264K7V", "/Grundskolor/Boras", "user3@my.domain", "5CD9264K6M", "/Grundskolor/Boras", "user4@my.domain"] My response to @Cooper who has tried to help me. When I try your code, @Cooper , like this. document.getElementById("btnserno1").addEventListener("click",fetchCBOU); function fetchCBOU(){ document.getElementById("idCBS").innerHTML = ""; var sernum = document.getElementById("serial").value; google.script.run .withSuccessHandler(printCBOUU) .queryCBOU(sernum); document.getElementById("serial").value = ""; } window.printCBOUU = function(CBOUU) { console.log('Device info: ' + CBOUU); // function splitItUp() { // using it as part of my code, with my return const data = CBOUU let a=data.slice(3,-2).trim().replace(/\], \[/g,'~~~').split('~~~'); let b=[]; a.forEach(function(r){b.push(r.split(', '));}); let html='<style>td,th{border:1px solid black;}</style><table>'; b.forEach(function(r,i){html+='<tr><td>${r[0]}</td><td>${r[1]}</td><td>${r[2]}</td></tr>';}); html+='</table>'; document.getElementById("idCBS").innerHTML = html; } I get an error, as it can't work with the data. Uncaught TypeError: data.slice(...).trim is not a function If I instead set data to what looks like my return and submits any serial. const data='[[[5CD9264KBW, /Grundskolor/Boras, user1@my.domain], [5CD9264K64, /Grundskolor/Boras, user2@my.domain], [5CD9264K7V, /Grundskolor/Boras, user3@my.domain], [5CD9264K6M, /Grundskolor/Boras, user4@my.domain]]'; Then it runs (doesn't use my input, of course) and this is what your forEach function looks like to me, @Cooper. As you can see it doesn't display the given data.  The page.html section for where the result is displayed looks like this. <table class="striped"> <tr> <td><h6>Serial</h6></td> <td><h6>Device OU</h6></td> <td><h6>Most Recent User</h6></td> </tr> <tr> <td><h6 id="idCB"></h6></td> <td><h6 id="idCBOU"></h6></td> <td><h6 id="idCBRecent"></h6></td> </tr> </table> <table id="idCBS"> </table> When I do get my many results to show here, I would, of course, like the headers to line up with the results. ALRIGHT, I NOW HAVE COME MUCH CLOSER TO A RESULT I LIKE! Now all the data is listed in columns. I borrowed some formatting suggestions from here, with a for-loop inside the array idea from another place to make the data display in a table, which probably can be done in several different nicer ways. Maybe even a way that will keep the alignment correct? This the current js. document.getElementById("btnserno2").addEventListener("click",fetchCBS); function fetchCBS(){ //This clears the results between searches. Else the html+= below will keep adding rows of data at the bottom. document.getElementById("idCBS").innerHTML = ""; var sernum = document.getElementById("serial2").value; google.script.run .withSuccessHandler(printCBS) .queryCBS(sernum); document.getElementById("serial2").value = ""; } window.printCBS = function(CBS) { console.log(CBS); var i,innerArray; var L = CBS[0].length; for (i=0;i<L;i++) { innerArray = CBS[0][i]; value1 = innerArray[0]; value2 = innerArray[1]; value3 = innerArray[2]; console.log(value1 + "__" + value2 + "__" + value3) // This creates the table in the idCBS spot. // Both <table> and <tr> bits can be removed, and result is still the same. let html='<style>td,th{border:0px solid black;}</style><table>'; html+='<tr><td>' + value1 + '</td><td>' + value2 + '</td><td>' + value3 + '</td></tr>'; html+='</table>'; document.getElementById("idCBS").innerHTML += html; } } //Code for the clearResults button document.getElementById("clearResults").addEventListener("click",clrResults); function clrResults(){ document.getElementById("idCBS").innerHTML = ""; } It is displayed in page.html like this. <h4>Results<button class="waves-effect waves-light btn-small" id="clearResults">Clear Results</button></h4> <table class="striped"> <tr> <td><h6>Serial</h6></td> <td><h6>Device OU</h6></td> <td><h6>Most Recent User</h6></td> </tr> <table id="idCBS"> </table> </table> This means I have the headers of the coming table visible before the search. But, since I use two tables, the headers aren't responsive, and don't adjust to the width of the coming columns which have wider values. It looks like this.  If I try to put the headers inside the html+= creation loop in js, I of course get repeated headers. If I instead put the headers inside the idCBS table on page they are wiped by the early document.getElementById("idCBS").innerHTML = "" command. If I don't use and instead choose either or , then the data isn't looped properly, and is instead appended to the same row. Maybe I haven't tried all combinations, but I did try quite a few. I'm guessing there is a better combination of js + html to display my data in a perfectly aligned table, I just haven't found a solution yet. And, now I did! Changed the table code a bit, so I could move the idCBS to where it didn't interfere with the headers. <table> <thead> <tr> <th><h6>Serial</h6></th> <th><h6>Device OU</h6></th> <th><h6>Most Recent User</h6></th> </tr> </thead> <tbody id="idCBS"> </tbody> </table> Columns now align! So, I'm good for now, but if anyone has suggestions for improvements, feel free to comment. I was shown that there is an alternative to moving idCBS. <table id="idCBS"> <tr><!-- table header --> <th>Serial</th> <th>Device OU</th> <th>Most Recent User</th> </tr> </table> Then use: var myTable = document.getElementById("idCBS"); myTable.insertAdjacentHTML("beforeend", html); But, if I don't move idCBS to then I can use my clearResults button, as it'll wipe the entire table. with idCBS in tdbody, the insertAdjacentHTML of course works fine there too. | | Duplicate notifications - react-native-push-notification Posted: 11 Jul 2022 04:05 AM PDT I have a problem with react-native-push-notification module on Android. After correct set up the notifications are delivered for generated device token. Unfortunately, every push notification is duplicated. At that moment I do not implement the channel name and the remote push notification is delivered twice to "Other" category. When there is a channel name Android displays the push notification as "Other" and "Category Name" in the Notification Module. <meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name" android:value="Channel Name"/> <meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description" android:value="Channel description"/> Is there any possibility to leave only one push notification. I am sure that push notification is sent once. I know that the library is not supported but unfortunately I do not have time for a change. I need a quick fix. I will be glad for help! | | Spring Boot LDAP authentication and matching with database users Posted: 11 Jul 2022 04:05 AM PDT I have a Spring Boot MVC application which uses LDAP for authentication. This works fine, but now I have to match authenticated user (from LDAP repository) with users from my database. I created LDAPUser: import java.util.jar.Attributes.Name; import org.springframework.ldap.odm.annotations.Attribute; import org.springframework.ldap.odm.annotations.Entry; import org.springframework.ldap.odm.annotations.Id; @Entry( base="ou=users", objectClasses = { "person", "inetOrgPerson", "top" }) public class LDAPUser { @Id private Name id; private @Attribute(name = "cn") String username; private @Attribute(name = "sn") String password; private boolean rememberme; } And LDAPUserRepository: import org.springframework.data.ldap.repository.LdapRepository; import org.springframework.stereotype.Repository; import com.licensewatcher.model.LDAPUser; @Repository("ldapUserRespository") public interface LDAPUserRepository extends LdapRepository<LDAPUser>{ LDAPUser findByUsername(String username); LDAPUser findByUsernameAndPassword(String username, String password); /*List<LDAPUser> findByUsernameLikeIgnoreCase(String username);*/ } and AuthUserService: import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.licensewatcher.repository.LDAPUserRepository; @Service("authUserService") public class AuthUserService { @Autowired LDAPUserRepository ldapUserRespository; public boolean authenticate(LDAPUser ldapUser) { //TODO: implement this!!! return false; } public boolean authorize(LDAPUser ldapUser) { //TODO: implement this!!! return false; } } Class WebSecurityConfig (extends WebSecurityConfigurerAdapte) configures application to submit login controller action: @PostMapping("/login/check") public String login(Model model, LDAPUser ldapUser, RedirectAttributes redirectAttr) { //TODO: call authUserService.authenticate(LDAPUser ldapUser); return "redirect:/login"; } I want to implement authUserService.authenticate(LDAPUser ldapUser) to check LDAPUserRepository first and if user exists, check up the User from my database. If they match, add user to a session and redirect to the requested page. Is this a good approach? Do you have any suggestions how this could be implemented in a more elegant way? Thanks in advance! | | How do I send an e-mail in Java? Posted: 11 Jul 2022 04:05 AM PDT I need to send e-mails from a servlet running within Tomcat. I'll always send to the same recipient with the same subject, but with different contents. What's a simple, easy way to send an e-mail in Java? Related: How do you send email from a Java app using GMail? | |
| Recent Questions - Arqade Posted: 13 Jul 2022 02:18 PM PDT | What's the difference between Charging, Official Charger, and USB Charger profiles in sys-clk manager? Posted: 13 Jul 2022 01:56 PM PDT In the Nintendo Switch homebrew overclocking application sys-clk, you can set different clock speeds based on 5 power profiles: Docked, Handheld, Charging, Official Charger, and USB Charger. Docked and Undocked seem self explanatory, but the three charging profiles confuse me. I assumed the Official Charger profile would only be used when connected to Nintendo's official Switch charger, but it also gets applied when using my Lenovo-branded laptop charger. What's the difference between the Charging, Official Charger, and USB Charger profiles in sys-clk? Why is the Official Charger profile applied when I use my laptop charger?  | | Is it possible to have every blaster shot hit? Posted: 13 Jul 2022 12:15 PM PDT Regular Attack and Rapid Shot fire a number of blaster shots, only a few of which ever seem to hit. Is it possible to have such a high dexterity that every shot hits (ie. all 6 shots of Rapid Shot, all 3 shots of Regular Attack)? | | What modern gamepad has the lowest actuation force and/or pre-travel/total-key travel on i.e. (X Y A B) triangle square buttons? [closed] Posted: 13 Jul 2022 06:30 AM PDT What modern gamepad has the lowest actuation force and/or actuation distance, total-travel on the right-side buttons? I refer to the X Y A B on an XBOX or the square triangle on a Dual Shock controller. | | What would have happened if no game consoles were released after the Nintendo 64? [closed] Posted: 13 Jul 2022 06:12 AM PDT Let's say that, through alien or divine intervention, something caused humans to be supernaturally unable to release any new hardware or make any new significant tangible (non-software) inventions from the day that Nintendo 64 was released world-wide. Any invention or hardware product that already existed at that date, however, can be built indefinitely in existing and maintained factories. (Including the N64 itself.) In such a world, would people have found ingenious software solutions to truly maximize the hardware of the Nintendo 64 and other then-current video game consoles and computers? With well over twenty years having passed since, and no new hardware to learn, would game developers have come up with all kinds of now-unthinkable hacks to enable breath-taking 3D worlds since they are not hobbyists homebrewing for a grossly outdated system, but highly paid programmers producing a steady stream of AAA titles with vast resources and accumulating experience? Is there really a "logical limit" that you hit in just a few years? I mean, look at some of the things that people made "in later years" for the Commodore 64. Same hardware as back then, and zero monetary incentive to do so, yet seemingly magical compared to what people assumed you could do with it when it was new/current. Who is to say that the same wouldn't happen with a console which, at least, is very competent at handling true 3D worlds from the get-go? | | What's the probability to get Fire Aspect on a Netherite sword? On a book? Posted: 13 Jul 2022 04:54 AM PDT I wonder if it's better value to get Fire Aspect 1 on two swords and merge them or if it's better to have instantly Fire Aspect 2 | | Failed to log in: Invalid session ( Try restarting your game ) [duplicate] Posted: 12 Jul 2022 07:23 PM PDT For the last few days I have been getting on Minecraft ready to play and I'd go to multiplayer and it would say Failed to log in: Invalid session ( Try restarting your game ) I tried restarting my game and launcher. I restarted my computer and logged out and into my Minecraft account. Nothing worked. I could not find any answers online and was wondering if anyone had the same problem as me and knew how to fix it. | | Can you use a classified weapon offline once you've unlocked it? Posted: 12 Jul 2022 05:54 PM PDT If I have unlocked a classified weapon online, could I use them in a local offline multiplayer match? | | Unable to select the "Talk Device" and go back to present in Minecraft Timecraft Posted: 13 Jul 2022 05:01 AM PDT I am in grade 2 of school. I am playing Minecraft Timecraft a on PC running windows 11. I am in New York-Jazz level 1. I want to go back in the control center and I need the Talk Device. But I can't select my Talk Device. It is in my inventory, but I am not able to select it.  Here is what I have tried: - checked minecraft help
- checked minecraft website
Links | | How to make blocks appear under your feet when you walk/jump? Posted: 12 Jul 2022 08:33 PM PDT Is there anyway to make blocks appear under your feet wherever you walk or jump? I there a way to make them disappear after like 20 seconds? | | Using Carnage to generate Rage with weapons other than the Chaoseater Posted: 13 Jul 2022 04:05 AM PDT The description of the Carnage enhancement says: I have the Tremor Gauntlet at almost the same level as my Chaoseater though, and I can't seem to get it to accumulate any Chaos. I've tried having Carnage equipped to both the Chaoseater and the Tremor Gauntlet, and in either case, I haven't been able to see any gained Chaos when either wounding or killing completely with the Tremor Gauntlet. How do I use the Carnage enhancement to gain Chaos when using the Tremor Gauntlet? | | Having trouble testing for mobs with command blocks Posted: 12 Jul 2022 04:56 PM PDT I'm trying to create a pokeball in Minecraft but I was wondering if there is any way for the command block to test for all mobs in a certain radius and give a different output depending on the mob without having to test for each mob individually with individual command blocks | | I need help with an only one command Posted: 12 Jul 2022 04:56 PM PDT I've been wanting Pokémon in Minecraft for a while now. I found A LOT of commands, but they weren't quite what I wanted. I finally found one I liked, but there's one problem: the Pokémon are disguised baby zombies, and I want to play on peaceful. Does anyone know of a quick way to convert this command from zombies to armor stands? Here's the command I was using: https://pastebin.com/kgPZy8c2 | | minecraft three entity spawner problem Posted: 12 Jul 2022 04:57 PM PDT I have been trying to make a spawner in minecraft that spawns 3 entities but it doesn't seem to be working. This is the command I have: /setblock ~ ~1 ~ minecraft:mob_spawner 0 replace {SpawnData:{id:"minecraft:cow",Passengers:[{id:"chicken",Passengers:[{id:"pig"}]}]},SpawnCount:10,SpawnRange:10,RequiredPlayerRange:100,Delay:2,MinSpawnDelay:1,MaxSpawnDelay:4,MaxNearbyEntities:100} But it isn't working it makes it and there is a cow in it but I waited for about 5 minutes and nothing. | | Über display in Team Fortress 2 Posted: 13 Jul 2022 01:43 AM PDT I'm using Chinese software and I changed system locale Language for non-Unicode programs in Region and Language (Win7x64, Control Panel) from English-US to Chinese (Simplified PRC). While I'm playing TF2, the Ü is replaced with a question mark. So all I can see is ?berCharge ?berectomy, and ?bersaw. To workaround this, I tried opening C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\resource\tf_english.txt. It's encoded in UCS2-Little Endian, so I tried to convert it to ANSI, UTF8... but failed. I ended up replacing all Ü characters with U in the text file... Is there a better work-around? | | No access to Wild West and Pirate Seas Posted: 12 Jul 2022 01:31 PM PDT I've played all 24 levels of Ancient Egypt and defeated Dr. Zomboss, but there is no access to Pirate seas or Wild West. I tried updating the game and resetting my iPhone but no joy. Before I give up and delete the game and redownload, I'd like to check that my copy really is defective (and it's not just me making some basic error) because I've bought extra plants in the Zen garden using the gems that I've won and don't want to lose them unless it can't be avoided. Thanks for any help. | | How do I finish the room with many useless doors (mausoleum)? Posted: 13 Jul 2022 07:49 AM PDT I found a room with about 50 doors arranged in four rows of four on each side of the cube, but with some removed/blocked. Every door I have gone through has brought me to a different door in the same room, but the world map shows that there is an exit to another room. Which of the doors should I go through to get to the next room?  | |
| Recent Questions - Ask Different Posted: 13 Jul 2022 02:03 PM PDT | Why does the "w" command display bash's arguments as "ÿ¿"? Posted: 13 Jul 2022 01:59 PM PDT The venerable w utility reports who's logged on, what processes they're running, etc. Why does it print two non-ascii characters, apparently as the (nonexistent) args for bash? In iTerm2 they render as white question marks on a black background. Piped to a file and viewed with vi, I see: 15:41 up 5 days, 1:46, 11 users, load averages: 1.67 1.69 1.47 USER TTY FROM LOGIN@ IDLE WHAT me console - Fri13 5days - me s000 - Fri14 28:15 -bash ÿ¿ /bin/bash me s001 - Fri15 3:21 -bash ÿ¿ /bin/bash When ssh'd into the mac from an xterm, they render as ▒▒ . Its man page suggests that it might print a hyphen, but doesn't even hint at Unicode. | | Accessibility: Mouse Pointer goes back to default Size during Screen Sharing (or Jump Desktop) Posted: 13 Jul 2022 12:59 PM PDT I need to have the mouse pointer larger than normal (I also use different colors). But when I screen share from Mac to Mac (both running Monterey), the cursor is the tiny default size. If I go into accessibility, the slider is still over to the right (large), and I even try moving it. I'm having this with both Mac's built-in screen share, and using Jump Desktop. I've also tried changing the "scaling" in the settings, but didn't make any difference. And what's really weird, even though the size is ignored, it DOES display the cursor in my alternate colors, just really small. | | iCloud file and sync Posted: 13 Jul 2022 12:46 PM PDT I have recently activated iCloud drive sync so, my I have basically uploaded the ~/Documents folder into the cloud. Everything worked as expected and now I can see documents on all my devices. When I work and I update a file, I see that it is synchronized with Cloud, as expected but, last week, it started to resync all the documents folder instead of the changed only and took one day. Today it still doing again. So, why? Is a normal behavior or a problem? How the sync with cloud algorithm works? The problem I can see is CPU is running at 70% and the fan is running at max speed for hours due to bird process execution. | | How to force quit a frozen system command prompt that asks for permissions? Posted: 13 Jul 2022 01:52 PM PDT I want to press "Don't Allow" but it has become a no-op, doesn't act. I don't want to press OK. This does not show up in the Force Quit applications option. I opened VS code in the Desktop directory by mistake and it started to ask me for permissions. I also quit (command+Q) VS Code. How can I move ahead without giving VSCode permissions to read my Documents or any folder? Update 1 I tried to force quit the Finder, relaunch it, and it did not work.  | | I can't turn on "Check spelling while typing" in Notes app Posted: 13 Jul 2022 10:42 AM PDT I can't turn on "Check spelling while typing" nor "Check Grammar with spelling". when I click on either the menu vanishes and nothing happens. Why is this happening? how can I fix this?  | | Can I use a iMac 2013 as an external monitor to a MacBook Pro 2021 Posted: 13 Jul 2022 11:28 AM PDT I've tried using target display mode and AirPlay - neither seem to work. Am I missing something? Surely there's a way to join the two…? | | HID driver not attaching to USB interface Posted: 13 Jul 2022 09:52 AM PDT I have a Blackstar ID:Core amp that I'm trying to connect to their "Architect" application. The Architect application looks for HID devices with Blackstar's vendor ID (as can be seen in IDA):  Debugging using lldb, it can also be seen that IOHIDManagerCopyDevices returns 0 devices. This is not surprising given what is shown in IORegistryExplorer:  However from Wireshark, it appears that interface 0 should be recognized as HID:  but for some reason Apple's HID driver is not attaching to this interface. Is this because the USB audio driver is already attached to interface 1? If so, is there any way to detach the driver on this interface? | | Run Pixelmator ML Super Resolution on multiple images from terminal? Posted: 13 Jul 2022 06:07 AM PDT Have about 1000 images with the size of 480x320px, and they are very poor quality. I tried the Pixelmator ML Super Resolution to increase the quality (1440x960) and it seems to perform well! So I thought to iterate the 1000 files, from terminal, and change the format from jpg to HEIC. When I tried this, the HEIC file is 142K and the originl jpg is 400K. So a win win?? But how can I iterate the files, use ML Super Resolution, and save the file to a new HEIC format? | | install docker engine without docker desktop on MacOS Posted: 13 Jul 2022 04:32 AM PDT Docker recently upgraded its license that using Docker Desktop is a paid feature. I don't use Desktop but I do use the built-in Docker Engine. The Docker > About implies they are two separate things:  My question is really two: (1) if I'm not violating licensure by only actually using the engine, then don't really need the rest but if not or just for grins' sake then (2) how to install docker engine without docker desktop? | | My macbook doesn't turn on by attempting lot of times Posted: 13 Jul 2022 01:03 PM PDT I am having a issue with my Macbook where it doesn't turn on (power-on) randomly, And turns on randomly by attempting lot of times to open it, what issues could I be possibly be facing? My laptop is heating up but but no signs of turning on. | | Application toolbar reduces height and spaces out icons very widely [closed] Posted: 13 Jul 2022 06:53 AM PDT I have developed a MacOS app with a toolbar in Catalina running on a 2013 Macbook Pro and the toolbar height is sufficient to show all icons in half the screen as shown below:  However a user has reported that their toolbar appears as shown below, where the toolbar is reduced in height and the icons so widely spaced that some are not shown and appear as pop-up menu items which are disabled. The version of MacOS being used is not known but is probably newer than Catalina. Is this a consequence of using a newer version of MacOS than Catalina? Is there a way of increasing the application toolbar height so that all icons are shown in newer versions of MacOS?  | | How to enable hibernation on M1 Mac Mini? [duplicate] Posted: 13 Jul 2022 06:11 AM PDT I did some research and found materials saying that Mac mini has this feature but I can't find it in pmset. There was an entry on changelog that big sur added hibernation.  Notes: A related but different problem is here: How to enable hibernation on M1 Mac This problem is likely about macbook instead of mac mini The reason why I want to enable hibernation mode on mac mini, which usually has a stable wall power and thus make hibernation mode pointless, is that I use my mac mini as a portable device, breaking this assumption. | | Can't click to allow giving permissions Posted: 13 Jul 2022 01:50 PM PDT For many apps, I can't give them permissions. This prompt pops up  But I when I click on it, both buttons don't do anything, and it just stays there, until I restart the computer. I've read that this could be due do some apps having control of the screen, and I've disabled both amethyst and hammerspoon, but the prompt stays there. I also cannot manually give Emacs permission, since Emacs doesn't show up under Security and Privacy, under the Reminders section. I believe I started having issues after the previous system update. The problem is the same as what is described here and here What is the cause of this and how do I fix it? | | Should my CPU load be that high? Posted: 13 Jul 2022 12:03 PM PDT I have a mid-2009 13" core 2 Duo MacBook Pro running High Sierra w/ upgraded 8 Gb RAM. On Activity Monitor I usually get 20-40% 'idle CPU' with only Finder, Safari (3 tabs) and Activity Monitor opened. There's also nothing plugged in. 'User CPU' load varies quite a lot, but never above 'System CPU' which is always around 50%. So I wonder if those are normal CPU loads for my mac.  My mac always feels kind of hot despite having just these 3 apps opened and using it on a flat, wooden surface, slightly below room temperature with no direct sunlight. I read that it could be an issue with the cooling system, but the fan seems to work fine and I already took some dust off inside my mac (without detaching/disassembling anything except the metal case; maybe I should clean some parts separately?). Apple Hardware Test also gave me nothing on a simple test. Thank you to anyone who might respond. | | launchd script file access blocked by sandboxd Posted: 13 Jul 2022 11:05 AM PDT I've written a small shell script that downloads some server data and saves them into a restic repository. The restic repository files are on a mounted volume. The script works fine if I run it in the Terminal. To run this script daily I created a launchd .plist file in ~/Library/LaunchAgents Watching the output logs, I can see that the restic command fails to access its files. The system logs show a sandboxd warning that blocked restic. I've granted Full Disk Access to the restic binary, but that didn't do the trick. What am I missing? | | How do I solve the Magic Trackpad 2 lagging on macOS Monterey? Posted: 13 Jul 2022 12:57 PM PDT The past week I upgraded from macOS 11 Big Sur to macOS 12.3 Monterey. My Magic Trackpad 2, which connects via Bluetooth, lags. If I simply move my finger, it takes a short time before the mouse movement starts onscreen. The same for a swipe for Spaces: I'd swipe, and only the second half of the swipe gesture was responded to. If I tap, I have to press, even though Tap to Click is turned on. Some experimentation showed that if I rested my finger on the trackpad for half a second, movement was then immediate, so it seems the trackpad is taking some time to realise my hand is present and then respond. I have tried connecting it via USB; restarting my Mac; and ensuring its battery is fully charged. But it's still lagging. How do I solve this? | | Magic Trackpad 2 - Orientation (Rotate by 180) [duplicate] Posted: 13 Jul 2022 09:04 AM PDT I've done enough googling and found the solution of: - writing defaults to com.apple.trackpad.orientation
- writing defaults to com.MultitouchSupport.
Neither of them work to rotate it for 180. Is there any other solution than third party software? (that somehow does manage to change the orientation). Thank you very much. | | MacBook does not shutdown from Terminal: "NO LOGINS: System going down at 14:54" [duplicate] Posted: 13 Jul 2022 09:16 AM PDT My MacBook is suddenly not working normally. I cannot restart or shut it down. When I try to use terminal it shows: NO LOGINS: System going down at 14:54 I logged out of my Apple ID and logged in again. However, it's still not working. I cannot use any buttons or applications. I only can use Siri to help start the applications. Anyone know how to fix it? Many thanks!  | | How to remove .Trash folder from iCloud? Posted: 13 Jul 2022 07:45 AM PDT There's an invisible folder in my iCloud folder -> .Trash iCloud seems to sync the mac's trash folder to the cloud. How do I remove/exclude it from there? If I try to delete it conventionally I get error code -50. | | How to reset graphics driver under macOS? Screen static/garbage but only on internal display Posted: 13 Jul 2022 09:09 AM PDT I have a Early 2015 MacBook Pro Retina 13" which suddenly developed a very odd and specific issue earlier today. When running only the internal display under macOS, the display is unusable - multicoloured garbage and static, moving across the screen. Yet when I hook up an external display the problem disappears and both the internal display and the external one show macOS correctly. When rebooting and choosing the boot menu with only the internal display, all is well again. When loading macOS, it's fine until about two thirds of the way through the progress bar, and then the static psychedelic freakouts happen again and you can't even see the login screen. Again, hooking up an external display makes both displays work again, until the external one is disconnected (HDMI or Thunderbolt, makes no difference) When rebooting to Windows 10 Pro under Boot Camp, with just the internal display, everything is fine. If I load from a Gparted Live USB I have, also fine. If I boot a macOS installer, again fine, up until the point a clean install of macOS is performed. It was running Catalina, but I've also tried Big Sur and El Capitan (which is what it shipped with from new I believe). Booting to Recovery from any version of macOS, or Safe Boot, and no issues, perhaps because Metal GPU drivers aren't loading. Not sure. Having done fairly extensive testing before reaching out here, this leads me to believe it is a software issue with macOS because the internal Retina display clearly works. I'm wondering if it's related to Display Scaling because I usually run it at the "Look like 1440x900" setting and for some reason when booting macOS, the Apple logo and progress bar are smaller as if the scaling is applied from boot, and that's causing a macOS-only problem. I've looked for potential Terminal sudo commands I could use to try and force a display driver reset or some such, but have not found any yet. I've seen display faults on Macs before, but never anything like this. It's incredibly bizarre and specific, not a complete display fault across the entire machine, just macOS when not Safe Booted. Any advice please? I literally can't work out what the issue is. And I don't want to just use it in Windows 10; it's a Mac, I need it running macOS and it needs to work when not hooked up to another display to get around the issue. | | Wifi Drops when in Clamshell Mode Posted: 13 Jul 2022 05:07 AM PDT I have a MacBook Pro (13-inch, M1, 2020) in clamshell mode, connected to a 4k monitor and power through a USB-C hub. If I use only the external screen, with the lid closed, wifi becomes unusable. As soon as I open the lid (both screens on, mirrored) the problem goes away. In closed-clamshell mode: moe@Moes-MBP ~> ping google.com PING google.com (142.250.217.110): 56 data bytes Request timeout for icmp_seq 0 64 bytes from 142.250.217.110: icmp_seq=1 ttl=117 time=254.020 ms 64 bytes from 142.250.217.110: icmp_seq=2 ttl=117 time=206.079 ms Request timeout for icmp_seq 3 64 bytes from 142.250.217.110: icmp_seq=3 ttl=117 time=1207.436 ms 64 bytes from 142.250.217.110: icmp_seq=4 ttl=117 time=214.452 ms 64 bytes from 142.250.217.110: icmp_seq=5 ttl=117 time=224.992 ms 64 bytes from 142.250.217.110: icmp_seq=6 ttl=117 time=230.388 ms ^C --- google.com ping statistics --- 8 packets transmitted, 6 packets received, 25.0% packet loss round-trip min/avg/max/stddev = 206.079/389.561/1207.436/366.069 ms Immediately after opening the lid: moe@Moes-MBP ~> ping google.com PING google.com (142.250.217.110): 56 data bytes 64 bytes from 142.250.217.110: icmp_seq=0 ttl=117 time=17.263 ms 64 bytes from 142.250.217.110: icmp_seq=1 ttl=117 time=17.297 ms 64 bytes from 142.250.217.110: icmp_seq=2 ttl=117 time=44.884 ms 64 bytes from 142.250.217.110: icmp_seq=3 ttl=117 time=13.996 ms 64 bytes from 142.250.217.110: icmp_seq=4 ttl=117 time=19.013 ms 64 bytes from 142.250.217.110: icmp_seq=5 ttl=117 time=22.815 ms ^C --- google.com ping statistics --- 6 packets transmitted, 6 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 13.996/22.545/44.884/10.329 ms What could be causing this? | | Use "startosinstall" to install macOS Catalina on External Drive Posted: 13 Jul 2022 01:00 PM PDT I want to use "startosinstall" so that I can install macOS Catalina onto an external hard drive in order to preload MacOS onto multiple SSD's quickly. I've researched into this and have found websites such as https://grahamrpugh.com/2018/03/26/reinstall-macos-from-system-volume.html which suggest using: /Applications/Install\ macOS\ Catalina.app/Contents/Resources/startosinstall \ --applicationpath /Applications/Install\ macOS\ Catalina.app \ --agreetolicense --nointeraction --volume /Volumes/External\ Macintosh\ HD I've tried running the above but have had no success and always find that I get this returned: Usage: startosinstall Arguments --applicationpath, a path to copy of the OS installer application to start the install with. --license, prints the user license agreement only. --agreetolicense, agree to license the license you printed with --license. --rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes). --pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall. --converttoapfs, specify either YES or NO on if you wish to convert to APFS. --installpackage, the path of a package (built with productbuild(1)) to install after the OS installation is complete; this option can be specified multiple times. --eraseinstall, Erase all volumes and install to a new one. Optionally specify the name of the new volume with --newvolumename. --newvolumename, the name of the volume to be created with --eraseinstall. --usage, prints this message. Example: startosinstall --converttoapfs YES but can't seem to actually get anything to run. If anyone could provide me with some working code or show me how to solve this problem, I would be eternally grateful. Thanks for your help | | Can a Mail.app smart mailbox take *nesting* into account? Posted: 13 Jul 2022 04:01 AM PDT I'm using the fairly old version 9.3 of Mail.app on a computer running El Capitan; I just set up my Gmail account with it, and it seems to be correctly syncing. For organization purposes, I would love to have a smart mailbox that simply contains every message not in another specific mailbox (edit: that is, a folder), which I'll call A. The problem is that I don't keep any messages directly in A -- I keep them in A's sub-mailboxes (sub-folders) B, C, etc, and the sub-sub-mailboxes of those in turn. So the smart mailbox is not very useful. Is there any way I can make my dream a reality: A mailbox that only lists messages that are not inside Mailbox A at any level? | | Find string anywhere, not only at the beginning of words, in Safari on the iPad Posted: 13 Jul 2022 12:40 PM PDT In Safari on macOS one can choose whether to match a word that starts with the string or that contains it (see answer to Safari web browser do not find strings on a page in the common way). For example, if Find on page is set to contains, searching for "os" in this page matches the "os" in "choose", while if it's set to start with it doesn't. Apparently I'm stuck with "starts with" on my iPad, but I would like to match all occurrences, anywhere. So is there a way to search for contains in iOS Safari? | | ⌘ Command+ C doesnt work and I cant do an "E" by holding ⇧ Shift Posted: 13 Jul 2022 07:06 AM PDT I already tried: - Force quit Finder
sudo launchctl start/stop com.apple.pboard - System Preferences> Keyboard> Modifier Keys > Restore Defaults
- System Preferences> Shortcuts> App Shortcuts> + (when I tried to write the shortcut in "Keyboard Shortcut" Command C doesnt work)
When I try to paste it's ok, it works. The problem is to copy, the shortcut doesnt work and the edit flash doesnt work too. Its the same with Shift + e The keys Command, Shift, C and e work separately. They dont work like shortcuts Model: Macmini6,1 | | How do I drag a text box in Preview? Posted: 13 Jul 2022 10:02 AM PDT When using Preview, I can create a text box to add text on top of a PDF. However, the text box is not always created in the correct area. I find that I can use the Arrow Keys to move the text box. Or, I can stretch the text box with my mouse and pointer. However, I cannot move the text box using my mouse. What am I missing? How do I do that? Apple's reference says, "To move the text box, just drag it." But, I haven't figured out how to do that. | | Open New Terminal From Finder When Terminal is Already Open Posted: 13 Jul 2022 09:55 AM PDT Is there a setting that will let me open a NEW terminal window when I select the Terminal application from finder if one is already open? What happens now is that it yanks me to the terminal window that is already open, which is a frustrating feature. Thanks | | How to see count of unread emails from the Mail app in the Mac OS menu bar? Posted: 13 Jul 2022 08:04 AM PDT What's the best way to see the count of unread emails from the Mail app in the Mac OS menu bar? (Bonus points if I can use it to open the Mail app as well.) I don't really use the Dock, and I've gotten used to apps like Airmail and Fantastical that use the Mac OS menu bar to show information, like e.g. the count of unread emails. The best I could find after a quick search was https://www.macupdate.com/app/mac/22042/mail-unread-menu (from this thread), which looks like it hasn't been updated in ~6 years and might not work without also installing the MailPluginFix plugin. Is that really the best way to do this? I'm using Mojave. | | socketfilterfw and repeating error messages Posted: 13 Jul 2022 06:41 AM PDT Every two seconds I get the following messages via Console: Standard 13:47:41.404793 +0100 socketfilterfw MacOS error: -67065 Standard 13:47:41.405321 +0100 socketfilterfw UNIX error exception: 3 Standard 13:47:43.393518 +0100 socketfilterfw MacOS error: -67065 Standard 13:47:43.393927 +0100 socketfilterfw UNIX error exception: 3 And they keep on and on. Turning off the firewall, they disappear, of course. Now I wasn't able to find the meaning of the mentioned error codes. Does anybody know what goes wrong here? | |
| OSCHINA 社区最新专区文章 Posted: 13 Jul 2022 01:46 PM PDT | TiFlash 源码阅读(二)计算层概览 Posted: 23 May 2022 09:00 AM PDT 原文来源:https://tidb.net/blog/2bd91f75 TiFlash 是 TiDB 的分析引擎,是 TiDB HTAP 形态的关键组件。TiFlash 源码阅读系列文章将从源码层面介绍 TiFlash 的内部实现。在上一期源码阅读中,我们介绍了 TiFlash 的存储层,本文将对 TiFlash 计算层进行介绍,包括架构的演进,DAGRequest 协议、dag request 在 TiFlash ... | | 基于 TiDB 场景式技术架构过程 - 理论篇 Posted: 21 Jun 2022 09:00 AM PDT 原文来源:https://tidb.net/blog/cfb0408d 背景 从事数据架构多年,一直被问到一些问题,例如:what、why。 what:产品的数据架构是怎样的 why:为什么是怎样的,选型依据是怎么样的 我一直回答不好这个问题,一是因为从研发转向数据架构规划,自己一直处在学习中,二是解决的问题,在问题发生时都没有可参考的大厂经验... | | 遇到慢SQL该怎么办?(下) Posted: 13 Jul 2022 12:21 AM PDT 在数据库的日常使用中,难免会遇到慢SQL,遇到慢SQL本身并不可怕,困难之处在于如何识别慢SQL并对其优化,使它不至于拖慢整个系统的性能,避免危害到日常业务的正常进行。 上期我们讲了索引原因、系统配置和资源竞争导致的慢SQL,今天我们继续分析和总结。 目录 表本身包含大量数据 SQL语句写得很差 总结 表本身包含大量... | |
No comments:
Post a Comment