Recent Questions - Ask Different Posted: 28 Jan 2022 07:35 AM PST how do I get my password prompt back? Posted: 28 Jan 2022 06:26 AM PST I recently installed a password manager and since then, Safari no longer prompts me to use saved passwords when signing in to websites etc. I have turned the password manager extension off but Safari still doesn't give me any prompts. How do I turn this back on? I'm using Big Sur 11.6.2 | cannot get the free space back removing bootcamp [closed] Posted: 28 Jan 2022 05:39 AM PST After restore bootcamp by Bootcamp assistant. The storage become free space , but I cannot get it back by resizeContainer. sudo diskutil apfs resizeContainer disk0s2 0 | profiling and code coverage analysis with llvm/clang Posted: 28 Jan 2022 05:06 AM PST I'd like to do some profiling and code coverage analysis on some C code. From webpages like here and here I see that I probably need tools like llvm-cov and llvm-profdata . But my Mac doesn't seem to have them. Anybody know how to install them? [P.S. I can see from the tag description on [xcode] that "Almost all questions about development or app distribution are off topic here". I apologize in advance if mine is such a question. If someone can point me to a better place to ask, or even to the FAQs which the tag description cites, I'll be grateful.] | Monterey Time Machine backups to Synology result in umount 100% cpu Posted: 28 Jan 2022 01:55 AM PST I'm using a Synology NAS as a target for Time Machine backup on macOS Monterey. Quite frequently, this results in an unkillable umount spinning a core at 100%. This started after I upgraded my trashcan-shaped Mac Pro from Mojave or Catalina (I forget which!) to Monterey. Truly weird is that this hangs any Chrome windows trying to load web pages. Nothing I've found other than waiting a few minutes until it finishes. Anyone else experienced this? How would I go about digging? Anyone know of a fix? This sounds similar but opposite: Safari's fine for me, but Chrome locks up. No answers on that thread either. | Every time I open terminal,I get the following thing. Please help guys Posted: 28 Jan 2022 01:53 AM PST Last login: Fri Jan 28 14:39:05 on ttys004 /Users/mahinp21/.zprofile:1: command not found: PATH /etc/zshrc:7: command not found: locale /etc/zshrc_Apple_Terminal:104: command not found: mkdir mahinp21@Mahins-Air ~ % | Safari keeps closing newly opened tabs, re-opening the tabs that I just closed or navigates back when using with Tab Group Posted: 28 Jan 2022 12:22 AM PST To illustrate the issue, think opening new tabs from Reddit's homepage for the posts that you find interesting and then Safari sometimes will just close the last tab you opened as you keep opening new tabs. Also, it will re-open tabs. For example, you Googled something and opened 1-2 of the results then closed the Google tab and switch to one of the new tabs and suddenly the Google tab will come back. Lastly, sometimes when you click on a link and navigate to another page in the same site, Safari will take you back. Thin clicking on someones profile on Twitter and just at the moment that the page loaded it will go back as if you clicked the back button. All this happens only when using Tab Groups. I regularly have 3-5 tab groups with 20-50 tabs opened, I know it's not ideal but that's how I do it. I actually filed a bug report through the Feedback assistant but so far no response. I also don't see other people complaining about it, so maybe there's a solution? I don't use too many add-ons, I just have AdGuard enabled as an adblocker. Any idea how to solve this? Thank you! | Get an Error when erasing my main drive on Vmware so I can download BigSur [closed] Posted: 27 Jan 2022 09:51 PM PST So when I click erase and rename the drive so that it will pop up to download big sur on, I get this error. Ive got no clue how to solve it and have seen no sollution. Is there anything obvious that i might not have done? | Autolaunch of Safari Posted: 28 Jan 2022 02:24 AM PST Safari is not my default browser. Something is launching that browser without any window, right in front of me. Because it's only showing up in the dock, I have no clue it's launched. I don't know why it's happening. Anybody know why this might be happening? I can't leave my computer in Safe Mode for a week (as was suggested elsewhere) and I don't want to start another user on this computer. Is there a way I can be notified when it starts up? I looked into Shortcuts but they don't have Automation like iOS . Truly odd behaviour. I need to fix this. Any insight appreciated. | AppleScript - detect IOS device connected to macOS and output name of device Posted: 27 Jan 2022 07:15 PM PST Does any know how to detect the name of the IOS device connected via a cable on macOS through AppleScript. This does every source but I'm looking to identify the source. tell application "iTunes" tell every source whose kind is iPod to update end tell Thanks | Access External Volume Before Interactive Login Posted: 28 Jan 2022 02:17 AM PST We are running a node service that needs to access an external volume (USB HDD). We've found that when we reboot the system and start the service via a plist in /Libary/LaunchDaemons our external volume is inaccessible to our service until we login interactively via Screen Sharing or VNC. How do we configure our server in such a way that our external volume is accessible immediately upon restarting, and does not require an interactive login? | Voice control continuous dictation drops out when switching application windows (Monterey, M1, 8GB) Posted: 28 Jan 2022 02:25 AM PST Voice control on Monterey (with M1 hardware) is now excellent, and I'm using it all the time for the past few days, along with the head pointer. It's now so good that I'm becoming frustrated that it's not perfect... I'm using ulysses alongside chrome, switching to Ulysses to take notes (by dictation). Sometimes voice control will enter a state where it will respond to commands (such as "press a key" (producing a letter 'a') but will not take continuous dictation. It's could well be a bug, but I'm trying to track it down, or at least isolate cause and effect. No luck yet.. More info: - switching voice control off and on again restores continuous dictation. Before I did that, it was responding only to commands, not continuous dictation.
- the microphone level indicator at the bottom right hand of the screen now does not update, perhaps suggesting a high tax on system resources from running voice control; or a lack of optimisation given it is still an early feature.
- I'm using an M1 mini with 8 GB of RAM & a usb snowball blue mic.
- unlike some enthusiastic reviewers suggested, these machines are not omnipotent. Activity monitor shows memory pressure yellow, and one red spike about when I switch to voice control on and off. I have no other significant applications are running other than chrome with quite a few tabs.
- I'm curious whether an M1 with larger memory may not have this issue, but don't have one to test as yet.
- I've now found one reliable partial work around/ isolation of the bug. If I have two microphones plugged in, and when it drops out, switch to the other microphone in voice control preferences, continuous dictation returns. This is of course very unergonomic, but it's better than nothing.
Can anyone who has an M1 with 16G+ RAM please check if continuous dictation works reliably without dropping out when switching between applications? I suspect this might help but do not have such a machine to hand at present. | Always start the Mac to Startup Manager without having to press and hold the Option key Posted: 28 Jan 2022 07:05 AM PST I frequently switch between mac OS and Bootcamp. So I was wondering if there is an option to not have a preferred Startup Disk and always start to the Startup Manager, like you would get when pressing the option key while booting. Google couldn't help so your support is much appreciated. | Why are many files and folders greyed out in Finder? Posted: 27 Jan 2022 06:07 PM PST When I navigate in Finder (or in File Save/Open windows) I often see various files and folders are shown in grey. I can navigate them as normal, so what does this mean? | iCloud stuck on "uploading X items (Y of Y)" - Monterey 12.1 Posted: 28 Jan 2022 06:01 AM PST I hope this can be an interesting topic also for those not affected by it. Some context first: MacBook Pro 2016 (15"), macOS Monterey 12.1, iCloud+ 200GB subscription. While it may happen from time to time for iCloud to get stuck during upload, this has been happening to me quite frequently ever since upgrading to Monterey. Syncing works normally, but iCloud seems to be processing an increasingly large amount of files which are marked as "to upload". Looking in Finder there is no dashed cloud, and I just see this: Now, what have I already done? Restart Mac; shut down wait and boot; reinstall macOS; boot in Safe Mode; signed out of iCloud > restart > sign in (with the included pain of having to sync again 100+GB of data); nothing seems to have a definitive healing effect. The only thing that seems to work around it, and that may lead to a cause is: Turn off Wi-Fi, wait until all system has gone offline Restart Mac, wait until all login items are loaded (and have realised there's no connectivity) Turn on Wi-Fi, wait and do not launch any apps, just launch Finder Here you will see the items count slowly but steadily declining until it all syncs back to normality. It appears to me that something has gotten stuck, or that something is keeping some files from uploading. I have used two utilities (Consolation and Cirrus) to browse the log and indeed when this happens iCloud seems to be stuck in a loop, but no relevant info is present there. For records, I have a pretty fast WiFi (up to 600/250 Mbps), but I have also suspected the ISP doing something I have no idea how to check that is boggling my connectivity. Has anyone encountered this issue, or does anyone have an idea of what could be going on here? Is there an Apple-approved/recommended procedure to get out of it? Log out/in is no longer an option for me as it didn't solve it. Thank you | Big Sur Finder iPhone File transfer to Mac external drive - over 24,000 files in a directory Posted: 27 Jan 2022 10:04 PM PST I'm trying to transfer a directory on an iPhone, using Finder on Mac. One of the subdirectories contains over 24,000 files. The transfer takes a long time and it seems that the files are slowly accumulating in transference. However, after the transfer is complete, for some reason, the entire thing gets deleted. I am wondering if this is because there are too many files, albeit in a subdirectory? Or what might be causing this... Or how would I transfer such a case? | Can't turn on Bluetooth in my MacBook Pro Posted: 27 Jan 2022 07:04 PM PST I can't turn on Bluetooth on my MacBook Pro. The Bluetooth Icon has a diagonal line through it and I can't move the switch to On. - I tried pressing Shift and Option, clicking on Reset the Bluetooth Module and restarting the laptop. It didn't work.
- I tried turning the Power Off and On. That didn't work.
- Now when I try to turn on Bluetooth Preferences I get a small Pane saying "You can't open the "Bluetooth" preferences pane because it is not available to you at this time." Underneath this it says, "To see this preferences pane, you may need to connect a device to your computer." So I connected my iPhone, but nothing happens. Any advice? Thanks
| What is the best method of syncing photos from iPhone to (windows) desktop? Posted: 28 Jan 2022 04:08 AM PST My parents use windows and iPhone, and I have to run tech support for them. The windows photo import tool fails, because the photo's arn't really on the device, and apple lies to windows saying that they are available for import, so it fails halfway. If I install iCloud for windows, will it sync photos to the laptop via photostream? or will it continue to delete photos after 1000 photos? If photostream isn't enabled, will it start randomly deleting photos older then 1000 days that my parents take, without them understanding what is happening? or will it give some sort of warning / clean up prompt? Or is this likely something they are already familiar with as (mildly tech illiterate) users. | Time Machine fails shortly after starting to prepare backup Posted: 27 Jan 2022 08:05 PM PST I have a problem with the Time Machine backup: 1-2 mins after starting the process (Backup is being prepared), it stops. Console logs: Backup failed (304: BACKUP_FAILED_PREFLIGHT_STAGE_SNAPSHOT_DIFFING) Failed to collect events for "Macintosh SSD - Daten" (device: /dev/disk1s1 mount: '/System/Volumes/Data' fsUUID: 37BA4BE5-ACF2-37EE-81E7-41B277B3CACE eventDBUUID: E0435E75-595E-4699-A798-47ADB7F3E85A), error Error Domain=com.apple.backupd.ErrorDomain Code=304 "(null)" Failed to enumerate snapshot diffs, error: Error Domain=NSPOSIXErrorDomain Code=83 "Device error" I switched already the HDD, it runs for 2-3 weeks and then I get the same error. Anybody can help? | Big Sur 11.1: AppleScript to Automatically Change Wi-Fi Networks Posted: 28 Jan 2022 02:00 AM PST So, like a user reported here on Stack Exchange, the built-in "networksetup" command in terminal is pretty unreliable at times. It's slow, and I've found for some reason dot1x never actually establishes properly for some types of Wi-Fi networks in my home. The solution: Create an AppleScript to simulate mouse clicks on the menubar to change between Wi-Fi networks. Why is networksetup so slow compared to manually changing Wi-Fi networks? The below script has worked fine for me until Big Sur: use application "System Events" property process : a reference to application process "SystemUIServer" property menu bar : a reference to menu bar 1 of my process property menu bar item : a reference to (menu bar items of my menu bar ¬ where the description contains "Wi-Fi") property menu : a reference to menu 1 of my menu bar item property menu item : a reference to menu items of my menu to joinNetwork given name:ssid as text local ssid if not (my menu bar item exists) then return false click my menu bar item repeat until my menu exists delay 0.5 end repeat set M to a reference to (my menu item where the name contains ssid) repeat 20 times --> 10 seconds @ 0.5s delay if M exists then exit repeat delay 0.5 end repeat click M end joinNetwork joinNetwork given name:"my network ssid" The reason why it broke is that Wi-Fi is no longer technically a direct option under the main menu bar. Instead, it's relegated to the Control Center in Big Sur, and I think there may even be another sub-module it's technically nested it within the UI. I've been reading for hours about people trying to overcome this challenge in Big Sur, for example, to automate a click on specific Bluetooth device, but many AppleScripts people wrote apparently broke in the 11.1 update, and I have no easy starting point here for how to figure out how to accomplish what I am trying to do for Wi-Fi. Any help here would be tremendously appreciated. Side note: I know the same user also posted a method using AppleScriptObjC, but as people pointed out, it's a huge security risk because you need to put your password somewhere as plaintext. The UI script is therefore the better option in my mind, so I'd like to get it to work again. | Time difference between Apple Health on iphone XR and Schwinn Trainer app Posted: 28 Jan 2022 03:03 AM PST I have a Schwinn recumbent exercise bike that uses blue tooth to update the Schwinn Trainer app on my iphone XR. The Schwinn trainer app automatically updates Apple Health. My problem is, that when I look at Apple Health, it shows the time of my exercise with the time an hour later than I actually rode the bike. That causes the exercise to show up on the next day in the Lose-It app if I complete my exercise after 11:00 PM. The time on my exercise bike, the Schwinn Trainer app and my iphone are all in sync. Does Apple Health have it's own time zone setting? | Installing windows on a MacBook Pro 15-Inch "Core 2 Duo" without Mac OS X Posted: 28 Jan 2022 02:33 AM PST I have this MacBook Pro: 2007 MacBook Pro 15-Inch "Core 2 Duo" 2.16 GHz (T7400) Intro. October 24, 2006 Disc. June 5, 2007 Order MA609LL Model A1211 (EMC 2120) Family Core 2 Duo/Late 2006 ID MacBookPro2,2 RAM 1 GB (upgraded to 3GB) VRAM 128 MB On this machine, there is no Mac OS X anymore. (I have the original install DVD + DVD Leopard + Snow Leopard.) Instead there is Debian 10.6 that I can use through command line only (TTY) I would like to install Windows 10: - via a USB bootable (my preference)
- or via bootable DVD
GRUB is installed and works - I can not use rEFInd for technical reasons. I can not use BootCamp as there is no Mac OS X on it. To install Windows 10 on this MacBook Pro, I was thinking booting with bootable device and install from Grub. I also have an old PC with Windows 10 installed and an new external DVD writer. What are my options? | Windows installation through the Boot Camp Assistant and SSD error Posted: 27 Jan 2022 11:04 PM PST I have a MacBook Pro 2017, and I've been trying to install Windows 10 on it for quite a while through the Boot Camp Assistant, but I was advised to purchase an SSD (Samsung T7 500 GB). However, that also did not solve my issue. Every time I try to install Windows, the first time the Mac boots from the external startup disk, I am faced with a BSOD error saying 'your computer ran into an error, please restart'. I have tried multiple Windows 10 ISO's 1909, 1809, 1607, and the current version 20H2 available on Microsoft (30th October 2020). I also reset PRAM before every installation. To install Windows, I followed this 9to5Mac tutorial, as well as the accepted answer to this question. | Is it possible for a Macbook Pro to pop out a window and / or give some sound a few minutes before sleeping? Posted: 28 Jan 2022 01:03 AM PST Is there a way to pop out a window and / or to give out some sound a few minutes before it goes to sleep? There is one warning, but I hope to get another warning a few or a couple of few minutes before it would go to sleep. Sleeping involves writing all data to the hard drive and reloading all data afterwards, and also any external SSD drive would report not being ejected properly. One way I can think of is to run a script either continuously or as a cronjob, and every 3 minutes, use some Unix command to get the battery level, and when it is 3% or lower, give out audio bell for 30 seconds. | iPhone XR's screen triggers other devices Posted: 28 Jan 2022 12:08 AM PST Recently I bought a brand new iPhone XR. When its screen is activated by some application (not necessarily a GSM call or a Wi-Fi thing), it affects other speakers or headphones around it. All of them sounds exact same 4 "buff" like sounds consecutively. It reminds me of the way old mobile phones affected the speakers around them. Is there anyone knows why it happens and how to prevent it? It annoys me and I really need a solution. | What is the purpose of Docker.raw file on Mac OS Catalina? Posted: 28 Jan 2022 02:18 AM PST I have Docker installed on my Mac OS Catalina and recently found very big file Docker.raw. It is 64 Gb. Is it really needed? And if so, why is it so big ? | Select a poster frame for video thumbnails in Photos app? Posted: 27 Jan 2022 07:45 PM PST Is there a way to select a Poster Frame to use as the thumbnail of a video in your Camera Roll? For example, many of my videos fade up from black. Because of this, the thumbnails are black and it's difficult to distinguish between videos. It also looks bad if a business is presenting videos to potential clients on an iPad. Can video poster frame thumbnails be added on iOS(preferably) or Mac? | How can I force Google Chrome to translate the current page without using the mouse? Posted: 28 Jan 2022 06:05 AM PST When browsing the web with various inputs and other keyboard actions, traveling from the keyboard to the touchpad to right click is fairly obnoxious. Google Chrome offers a "Translate to English" option in it's right click menu, something I find myself having to use often as I browse sites with English and another language. Is it possible to invoke this option via a keyboard shortcut, or other non-mouse based method? | Error -36 on a brand new Samsung 850 SSD drive Posted: 27 Jan 2022 09:00 PM PST I, after some adventure (as described here), have successfully booted OS X installation from a brand new SSD by Samsung (EVO 850). I am running OS X 10.11.6 (Trim is not enabled). My Mac is mid-2009 MacBook pro. When installing, I have restored a Time Machine state. Now, whenever I try to access large files on the disk, they fail to be copied with an error message -36: saying that the source file "cannot be read or written". I am able to successfully copy files from the backup disk or from the internet to the SSD, but once there, they cannot be copied further (they can be moved, but this is just a bookkeeping operation, no data is read then). So it seems the problem occurs when the OS tries to actually read something besides FS entries. The error persists both in Finder and Terminal. The SSD is brand new. It has an uptime of 7 hrs and 41 power cycles. It comes clean with Disk Utility - no problems detected, but I guess this tool does not perform disk read/write integrity test, just checks FS entries. Am I right? So what options do I have here? | Is there a Mac screen capture tool that will export to animated gif? Posted: 28 Jan 2022 12:20 AM PST I'm looking for a screen capture tool working on MacOSX that will export the capture to animated gif. | |
OSCHINA 社区最新专区文章 Posted: 28 Jan 2022 06:28 AM PST LeetCode 17. 电话号码的字母组合 Posted: 28 Jan 2022 03:30 AM PST 具体思路: 典型的排列组合问题,需要注意一下递归写法; 具体代码: class Solution { public: vector<string>dic = { "","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; void fun(vector<string>& ret, int index, string digits,string now) { if (index == digits.size()) { ... | LeetCode 605. 种花问题 Posted: 28 Jan 2022 01:56 AM PST 基本思想: 注意特例,首尾添0最可靠; 具体代码: class Solution { public: bool canPlaceFlowers(vector<int>& flowerbed, int n) { int cnt = 0; int index = 0; flowerbed.insert(flowerbed.begin(),0); flowerbed.push_back(0); for (int i = 0; i < flowerb... | LeetCode 300. 最长递增子序列 Posted: 28 Jan 2022 01:36 AM PST 基本思路: 老生常谈的DP问题,没什么可说的,肌肉记忆; 具体代码: class Solution { public: int lengthOfLIS(vector<int>& nums) { if (nums.size() == 1) return 1; vector<int>dp(nums.size()); dp[0] = 1; for (int i = 1; i < nums.size(); i++) { ... | |
OSCHINA 社区最新专区文章 Posted: 28 Jan 2022 05:19 AM PST springboot怎么使用同一张临时表 Posted: 27 Jan 2022 08:51 PM PST mybatis里面有一个对临时表更新的方法,像这样的update #test set name='测试'的方法A ,然后有个名字的list在服务层循环对这个表更新,像这样的: for(String name:names){ 方法A(name); } 但是执行后提示找不到表#test 连接池是自带的hikari... | 开源爱好者月刊《HelloGitHub》第 70 期 Posted: 27 Jan 2022 04:39 PM PST > 兴趣是最好的老师,**HelloGitHub** 让你对编程感兴趣! ![](https://img2022.cnblogs.com/blog/759200/202201/759200-20220127210546594-111375321.png) ## 简介 **HelloGitHub** 分享 GitHub 上有趣、入门级的开源项目。 > [https://github.com/521xueweihan/HelloGitHub](https://github.com/521xueweihan/HelloGit... | TCP长连接实践与挑战 Posted: 26 Jan 2022 11:51 PM PST 👉 点这里立即申请 本文介绍了tcp长连接在实际工程中的实践过程,并总结了tcp连接保活遇到的挑战以及对应的解决方案。 作者:字节跳动终端技术 ——— 陈圣坤 概述 众所周知,作为传输层通信协议,TCP是面向连接设计的,所有请求之前需要先通过三次握手建立一个连接,请求结束后通过四次挥手关闭连接。通常我们使用TCP... | |
Recent Questions - Arqade Posted: 28 Jan 2022 05:16 AM PST PS5 controller doesnt (?) charge Posted: 28 Jan 2022 04:08 AM PST I have bought controller to use on PC. But when I connect it to USB to charge, orange light glows once and stops. If I connect it to Mac, it glows solid orange with white middle light. It should blink orange when charging right? I tried multiple cables, laptop charger, computer USB port charging, phone charger - orange just blinks once. What is the problem here? | How can i find anvil GUI nbt? Posted: 28 Jan 2022 05:09 AM PST So i'm trying to to make a datapack, where you can enchant blocks with enchantments on an anvil in survival. I've tried getting player's data, block's data, but i can't find where the anvil GUI nbt is stored. | Extra bonus board glitch Posted: 27 Jan 2022 05:41 PM PST So, for the past few days I have been trying to get all the bonus boards and a few minutes ago I did but the thing is though is that there are 250 boards in total right? well I have the accolade for 50 fast travel boards and all 250 boards, but it says I only have 199 out of 200 xp boards is this a bug or am I actually missing a xp board | What is the Most Score Anyone has Ever Gotten on Google Cricket Posted: 28 Jan 2022 12:33 AM PST I've been playing a lot of Google Cricket lately and that got me thinking, what is the highest score anyone has ever gotten in Google Cricket? I know the cap is 999 but I found that you can see your real score by hitting the share button and sharing the url. So that begs the question, what is the highest score anyone has gotten? | Minecraft White screen 2 [closed] Posted: 27 Jan 2022 03:11 PM PST Minecraft 1.0 has is stuck on a white screen when loading I posted this same issue on a guest account but I cant acsess my guest account now. If you want, we can discuss my launcher logs through a different way because of the text limit Edit: Here are my launcher logs file:///Users/kaylianpanchoo/Desktop/Logs.pdf | Best way to deal with building full of shulkers? Posted: 28 Jan 2022 12:27 AM PST I finally defeated the Ender Dragon, and went looking for End Cities. I found one, and entered the building at the bottom of the city. There were two shulkers at the bottom and I destroyed them, and traveled upwards and there was at least 3 shulkers all shooting at me. I used my shield but it's nearly impossible to avoid those stupid things they shoot, half the time they hit me from behind. I ended up floating to the top of the building and was trying to land on a balcony, but when I got there I was hit by another shulker shot and died. I really need to get that stuff back. What's the best way to deal with a building full of shulkers? I need to kill them and get my stuff. Keep in mind, I haven't found Nether Wart yet. Thanks. | How far (distance) can Minecraft spiders jump? Posted: 27 Jan 2022 05:27 PM PST I am not looking for how high (Y) a spider can jump. I am looking for how far (X or Z) a spider can jump. Let's say I have a spider sitting on a edge. How many blocks apart does the opposite edge need to be so that the spider can't jump and land on it? spider XXXXXX<- distance ->XXXXXX | Extend redstone signal maintaining signal strength Posted: 27 Jan 2022 04:36 PM PST I'm trying to build an archery range with targets of varying distances. When you shoot one of the targets the signal travels through the ground to the very back of the range. At the back there's a high wall with redstone lamps at the top to indicate how accurate your shot is. I am wondering how do I extend the redstone signal to reach the back wall and maintain signal strength. For example, if I shoot a target which produces a signal strength of 4, I want the signal to travel x distance to then light up 4 redstone lamps. | Where is the guard that drops the "Bearer of sorrows"? Posted: 27 Jan 2022 05:05 PM PST According to the PAthfinder:Wrath wiki, the Bearer of Sorrows drops from "Senior guard in the Fleshmarket in act 4". But in the Fleshmarket there is no "Senior guard" - there are slave traders, two regular guards, a pirate and various traders that you can attack via dialog option. But no "senior guard". | Is it possible to drop a redstone torch so it powers something? Posted: 27 Jan 2022 09:51 PM PST On the black plasma animation "Survival" a character sets up a redstone trap. In one of the sequences, a dropper (or dispenser, couldn't tell) is activated and drops a restone torch. this torch falls nearby a powered rail and activates it. Is this actually possible to do in game? | How to check if item exists before giving the player a new one Posted: 27 Jan 2022 04:04 PM PST I have tried a few ways and tried many commands but I just don't seem to get it right. What I'm trying to do : I have a Minecraft realm with a town center where each player can press a button, which triggers a command block, giving them one pickaxe with a unique identifier (not sure what or how). Would be nice if the pickaxe could be named after the player who pressed the button like "Minecraftuser12312 Pickaxe" but not important, If they press the button again I need to make sure they do not have the item and if the item is also not just thrown out to pick another one up from the command block. Any help would be appreciated <3 Things to know : I am the realm owner and command blocks are enabled in the world. | Minecraft Launcher won't open at all Posted: 27 Jan 2022 03:47 PM PST I have attempted to run the Minecraft launcher several times but it won't respond at all. It has previously worked just fine on this machine, the only thing different is that my OS (Windows 10) recently updated, and this is the first time I have attempted to run it since then. I have tried to troubleshoot it in several ways, I have erased the profiles.json file in .minecraft , to no avail. Then, I tried updating Java. When that failed, I tried running the game in compatibility mode. As a last resort, I went nuclear and completely wiped any Minecraft files in my computer. All other threads I've found tell me to do one of the above, and it'll work, the rest say that its something to do with a faulty driver, but considering Minecraft is the only thing not working (And I do run a load of games and graphics design programs), I'm a bit skeptical that it's that. After all of those attempts I'm getting a bit worried that it's something related to that fateful Windows update, as they all seem to break something when they happen and unfortunately can't be toggled off (If someone can show me the way to permanently disable those too, I'd be grateful) Some more system information: - Windows 10 Pro 64x
- GEforce GTX 1050 TI
- Asus B85 Pro Gamer
- Intel Core I7 4770 8x @3.4ghz
- 16GB RAM
Edit: More information, as requested. It's not that the launcher crashes upon executing, it simply won't be executed or opened at all, without any new windows being opened, any error messages, crash logs or new processes in the Task Manager. All I get as a feedback is a split second of the mouse loading animation. I have been told to look through the crash logs, but since I did a fresh install while removing all Minecraft related folders and files from my computer, there doesn't exist a .minecraft directory where the crash logs are being generated. I have also attempted to utilize the alternative launcher, as indicated by another user, as provided in Mojang's website. I run in exactly the same problem: Nothing is opened, I get no new processes, and there are no crash logs. I attempted to execute it with administrator privileges turned on, as well as through the command prompt directly, to no avail. I get the same feedback as trying to open the default launcher, a split second of the mouse loading animation. | Minecraft sprinting while running and jumping Posted: 27 Jan 2022 07:06 PM PST I have been playing on the same computer for about 5 years and it worked perfectly. Now for some reason i can not jump while running woth sprint or just at all walking and jumping. I try to do it and i just jump in place. I tried changing version and it did not work. I try to run and jump and it goes well for about 1 or half a second and then i jump in place with no movement at all for like 5 seconds and that has been happening for about 2 weeks now. On all servers. I didnt change anything in my computer, version or buttons. It just started happening out of nowhere. What do i do? Sorry for mistakes, English is not my main language. | "We tried to sign in to your microsoft account, but something went wrong" in Minecraft for Windows 10 Posted: 27 Jan 2022 02:06 PM PST In minecraft v1.16.201 when I try to log in to my Microsoft Account I keep getting this message: "We tried to sign in to your microsoft account, but something went wrong" My os is Windows 10 Pro Versión 1909 (18363.1256) Any suggestion? | How does the Golden Lute (the weapon) work? Posted: 27 Jan 2022 03:49 PM PST When you fight the Necrodancer, you can only damage him using a unique weapon, the Golden Lute. What is the attack pattern on this thing? Does it attack two squares in front of you, one? Does it attack diagonally? How much damage does it do? I can't seem to figure it out. | How to tell the number of wins with any given civ? Posted: 27 Jan 2022 03:17 PM PST In Age of Empires II DE there are special icons for when you win 10 and 100 times with any given civilization. Is it possible to see how many wins you have with each civ towards the icons without manually counting the results from saved replays? I can find number of total wins and my "best" civilization, but I can't find per-civ statistics. | Do obstacles slow down troops in Clash of Clans? Posted: 27 Jan 2022 07:25 PM PST I noticed that when attacking in multiplayer, my ground troops avoid running through obstacles such as trees. Instead the troops walk around the tree (or other obstacle). I'm wondering if obstacles actually slow the troops on their way to a building or if their horizontal/vertical/diagonal speed is still the same? I also wonder if anyone has tried to place obstacles (using a shovel) as an actual defense advantage? Here's a funny base my friend came across once: | How to tell if a certain item is in a player's inventory, or a specific inventory slot? Posted: 27 Jan 2022 08:36 PM PST I am trying to create a challenge world where a certain item (in my example, a Netherite Sword) must be collected. Using commands, how can I if a player has it, and then run a command, for example, congratulating the winner? I am also looking for a way to detect these items in a specific item slot. For example, a pair of Netherite Boots should run some commands to give the player the Speed effect when worn. Is this possible? This question is specific to Bedrock Edition 1.16. See also: Testing for a certain dropped item Browse more workarounds for getting/setting NBT in MCBE | What is the purpose of the dungeon in Future Hyrule Castle? Posted: 27 Jan 2022 03:44 PM PST After you get transported to the future in Cadence of Hyrule, there are just a few options for where to go: - Go down the stairs and fight your way through a typical dungeon.
- Go into the main castle entrance and fight Ganon.
- Go into the side entrance to solve a puzzle for an item.
It seems strange that you can fight Ganon without going through the dungeon first. Upon completing the dungeon, it leads out to the right castle wall. Although it appears that you couldn't get to this place except by going through the dungeon, it doesn't seem like there is anything to do here. Is there an item or a secret that requires completing the dungeon? I can't remember if we received any of the unique/legendary weapons in this dungeon; but even if we did; we could have just warped out after getting all items instead of actually completing the dungeon. | What does map ban mean? Posted: 27 Jan 2022 02:45 PM PST Watching StarCraft: Brood War leagues like ASL or KSL, I see that in the information panel of each player there are maps that under the category "BAN". What does this this 'ban' mean, exactly? | How to turn off chat in Minecraft on mobile device Posted: 27 Jan 2022 06:04 PM PST I read that you can go into multi player settings and scroll to turn off chat but I don't see this option in the mobile app version on my sons ipod/iPhone. Is there a way to turn off chat on the iPod or iPhone app version in Minecraft? | How to get a new villager Posted: 28 Jan 2022 05:05 AM PST I was going to get a saddle but I found that all my villagers were gone how do I get more. I am on a survival world so I cannot spawn them in using spawn eggs. | Bought a 2 pack on Steam, but the second one isn't in my Inventory? Posted: 27 Jan 2022 03:45 PM PST I bought a '2 pack' of 7 days to die. I can install the game, but the second access/copy/key isn't in my inventory as a 'gift'. I wrote to Steam Support but did not get an answer. Can anybody advise me? | Watch Dogs plot hole: Keeping your identity secret Posted: 28 Jan 2022 01:35 AM PST This is either a gaping plot hole staring me right in the face or I must have missed something. Alright, so you take certain measures to make sure your identity as the vigilante is kept secret, for instance scrambling all ctOS camera feeds to blur your face rendering it unable to identify you, even going to extreme lengths in the instance of that one prison mission to make sure the witness from the stadium does not talk. All understandable, to make sure no one figures out who you are & ends up going after your family, all to keep them safe. Fine. BUT. At one point while I'm driving around a message comes on the radio where the announcer says something along the lines of "Police are still looking for vigilante Aiden Pearce, but with the Chicago public supporting Pearce police are having a hard time figuring out his whereabouts". And it wasn't like a major news headline "We discovered who the vigilante is!" or anything of the sort, the announcer just casually states the vigilante's identity. So what boggles my mind is..if it's public knowledge.. why am I doing all this to keep my identity secret?! If who I am is already public knowledge, why hasn't the police gone for my family or something? Not to mention when you're walking in the street & you'll come across the occasional bystander that'll be like "Hey! That's the guy from the news!" or "Hey, that's the vigilante!", & pull out their phone to take a picture of me with Aiden taking NO reaction whatsoever to delete the photo or block their camera or anything. He just casually strolls on. How the hell is that bystander able to identify me?! Don't I have my mask thing up everytime I'm on the news? And why doesn't Aiden do anything about it?! Someone please, is this a massive plot hole or am I missing something?? | Is it possible to obtain all TM's? Posted: 27 Jan 2022 06:52 PM PST I'm afraid that throughout the course of my game I have taken some actions which may prevent me from obtaining a TM. Is it possible for this to happen, or is it always possible to acquire every TM? | |
Recent Questions - Unix & Linux Stack Exchange Posted: 28 Jan 2022 12:52 AM PST Excel - Highlight selected/active cell keeping old color Posted: 28 Jan 2022 12:45 AM PST | What is the difference between a systemd scope and a systemd slice? Posted: 28 Jan 2022 12:05 AM PST What is the difference between a systemd scope and a systemd slice? Both are for resource management. But what can you do only with a slice and what only with a scope? | How to copy multiple files to different locations through package() in PKGBUILD Posted: 27 Jan 2022 11:23 PM PST I am new to PKGBUILD. I created an AUR installer tool and for that I am creating PKGBUILD file. After so much reading and video tutorials, I have come up with this so far. Basically, I have a .desktop file that I need to move to /usr/share/applications . In addition there are some scripts and icons that I want to copy to $HOME/.aurin . # Maintainer: Suleman Elahi <suleman@ilfrs.ga> pkgname=aurin pkgver=0.1 pkgrel=1 pkgdesc="Aurin is AUR packages installer." arch=("any") url="https://github.com/suleman-elahi/aurin" license=('MIT') depends=('libnotify' 'tk') source=("git://github.com/suleman-elahi/${pkgname}/") sha1sums=('SKIP') package() { mkdir -p $pkgdir/$HOME/.aurin/ install -D -m755 ./data/aurin.desktop $pkgdir/usr/share/applications/aurin.desktop xdg-mime default aurin.desktop x-scheme-handler/aurin install -D -m755 ./data/askpass $pkgdir/$HOME/.aurin/askpass install -D -m755 ./data/aurin.png $pkgdir/$HOME/.aurin/aurin.png install -D -m755 ./data/aurin48.png $pkgdir/$HOME/.aurin/aurin48.png install -D -m755 ./data/install $pkgdir/$HOME/.aurin/install install -D -m755 ./data/installpkg.sh $pkgdir/$HOME/.aurin/installpkg.sh install -D -m755 ./data/passprompt $pkgdir/$HOME/.aurin/passprompt install -D -m755 ./data/runner $pkgdir/$HOME/.aurin/runner make DESTDIR="$pkgdir/" install } Basically, I am copying files to different locations. But when I install through it, I get: ==> Starting package()... install: cannot stat './data/aurin.desktop': No such file or directory ==> ERROR: A failure occurred in package(). Aborting... [archlabs@archlabs Aurin]$ I know I am making a mistake it's just I don't know what it is. Need help with this. Thanks. | Failure while connecting external harddrive Posted: 27 Jan 2022 11:08 PM PST I am trying to connect a seagate external drive to my PC that runs Manjaro 5.15.16-1 . However, it is not detected by the system. It is not listed in /dev/ , I can't view it with fdisk -l . But, I can see it through lsusb. Here is my dmesg output when I plug my drive in. [ 1298.309372] usb 1-4: new high-speed USB device number 21 using xhci_hcd [ 1298.464162] usb 1-4: New USB device found, idVendor=0bc2, idProduct=ab44, bcdDevice=48.85 [ 1298.464179] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 1298.464185] usb 1-4: Product: Backup+ Hub [ 1298.464190] usb 1-4: Manufacturer: Seagate [ 1298.464194] usb 1-4: SerialNumber: 01CB0037B432 [ 1298.465693] hub 1-4:1.0: USB hub found [ 1298.466048] hub 1-4:1.0: 3 ports detected [ 1298.582970] usb 2-4: new SuperSpeed USB device number 23 using xhci_hcd [ 1298.602988] usb 2-4: New USB device found, idVendor=0bc2, idProduct=ab45, bcdDevice=48.85 [ 1298.603011] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 1298.603014] usb 2-4: Product: Backup+ Hub [ 1298.603020] usb 2-4: Manufacturer: Seagate [ 1298.603022] usb 2-4: SerialNumber: 01CB0037B432 [ 1298.605760] hub 2-4:1.0: USB hub found [ 1298.606064] hub 2-4:1.0: 3 ports detected [ 1299.539488] usb 1-4-port2: Cannot enable. Maybe the USB cable is bad? [ 1301.095960] usb 2-4.1: new SuperSpeed USB device number 24 using xhci_hcd [ 1301.113319] usb 2-4.1: New USB device found, idVendor=0bc2, idProduct=ab38, bcdDevice= 1.00 [ 1301.113338] usb 2-4.1: New USB device strings: Mfr=2, Product=3, SerialNumber=1 [ 1301.113346] usb 2-4.1: Product: Backup+ Hub BK [ 1301.113352] usb 2-4.1: Manufacturer: Seagate [ 1301.113357] usb 2-4.1: SerialNumber: NA9QY9SY [ 1301.120343] scsi host2: uas [ 1301.121106] scsi 2:0:0:0: Direct-Access Seagate Backup+ Hub BK D781 PQ: 0 ANSI: 6 [ 1301.122043] sd 2:0:0:0: Attached scsi generic sg0 type 0 [ 1301.122365] sd 2:0:0:0: [sda] Spinning up disk... [ 1302.149335] .......................ready [ 1324.443771] sd 2:0:0:0: [sda] 11721045167 512-byte logical blocks: (6.00 TB/5.46 TiB) Any kind of help would be appreciated! edit: I think it should be worth mentioning that the drive is not partitioned. | users command does not show recently added users Posted: 27 Jan 2022 10:42 PM PST I have created few users: sudo useradd bart sudo useradd marge sudo useradd lisa sudo useradd maggie These users now exist $ awk -F: '{ print $1}' /etc/passwd blueray bart marge lisa maggie However these users does not show up on users command output $ users blueray What might be the reason? | How to use all disk space available on Linux Mint? Posted: 27 Jan 2022 09:39 PM PST I'm new to Linux and Linux Mint - but I recently flashed Linux Mint on my 16 GB USB drive (dual-boot), and for some reason Linux Mint is giving me warnings that there's no space left. When I go to check how much disk space is available, it's saying that there's only 8.3 GB of space available in total, where there should be 16 GB. How do I get Linux to use all of the space on my USB? Am I doing something wrong, or am I just misunderstanding something? Cheers, Tom | Can I run both Wine and Wine Staging on the same OS without any interference between both? Posted: 27 Jan 2022 09:38 PM PST I'm asking before trying because I already have a few things set up in Wine Stable, so I don't want to mess things up by installing something else over it. Basically, I want to install Staging because I have an app which is said to require the former to function properly under Linux (it's a music player.) Will installing Staging affect the way Wine Stable behaves? If so, how? Can I configure Wine Stable and Wine Staging separately? I'm running Debian Bullseye Stable. Thank you. | How to get the full console log of my tmux session on Linux? Posted: 27 Jan 2022 09:26 PM PST I have a Linux VM on Google Cloud and it has a tmux session which is running a .py file and I am trying to get the console log, but I can't scroll up or anything. Any idea? | Why wait in this script is not executed after all subshells? Posted: 28 Jan 2022 12:10 AM PST In this script, that pulls all git repositories: #!/bin/bash find / -type d -name .git 2>/dev/null | while read gitFolder; do if [[ $gitFolder == *"/Temp/"* ]]; then continue; fi if [[ $gitFolder == *"/Trash/"* ]]; then continue; fi if [[ $gitFolder == *"/opt/"* ]]; then continue; fi parent=$(dirname $gitFolder); echo ""; echo $parent; (git -C $parent pull && echo "Got $parent") & done wait echo "Got all" the wait does not wait for all git pull subshells. Why is it so and how can I fix it? | top command and + and * symbols Posted: 28 Jan 2022 12:30 AM PST I am trying to fetch memory usage with below top command. KiB Mem : 8009480 total, 1438848 free, 1964392 used, 4606240 buff/cache KiB Swap: 7340028 total, 5302364 free, 2037664 used. 5202692 avail Mem top -p $PID -n 1 -b | grep 'KiB Mem :' | awk -F, '{print $3}' 1963780 used Strangely sometimes I receive the output as *"15108960+used"* I am not able to understand why are the + ,* symbol coming in between sometimes. I couldn't find anything in man page about it. What does that mean? How do I make top command print without * and + in the output. Note : Running in CentOs Machine. | How to programmatically maintain umask in /etc/profile and /etc/bashrc Posted: 27 Jan 2022 11:31 PM PST I am looking for a way to programmatically maintain a consistent umask in the files /etc/profile and /etc/bashrc . They have an entry such as follows: if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then umask 002 else umask 022 fi So I would like to programmatically check for the first if statement above. If found, check to verify the next line is a umask (and not a comment) and if so, set it back to my standard umask if it has deviated from it. I realize I could just copy the entire file but would rather not disturb other changes that may have been made. I'm sure someone has done with with sed/awk/grep and can share or perhaps have thoughts on how to achieve this? I am required to maintain a umask for the login shell and for the non-login shell. It references this at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/assembly_managing-the-umask_configuring-basic-system-settings. Thank you. | Why can't I install an almost indentical kernel on brand new debian 11? Posted: 27 Jan 2022 10:44 PM PST My overall objective is to build an RT_PREEMPT kernel that I can modify. As an intermediate step, I'm trying to build and install (and run as a grub entry) a generic, non-RT_PREEMPT kernel. But I think the question below is valid, even without mentioning RT_PREEMPT. Here's the scenario: - brand new install of Debian 11 from the .iso
- download what I believe is as close to the same kernel source from kernel.org.
- build,
- boot fails with:
Loading initial ramdisk ... error: out of memory. Press any key to continue ... If I press a key, the process continues briefly before the kernel panics because it can't mount root. I'm new to Linux, but this seems like such a basic thing that it should work. So I'm doing something wrong, but don't know what it is. The out of memory error seems not that common, so here I am asking for help. Here are more details of my process: - download the .iso from debian.org (debian-11.2.0-amd64-netinst.iso) and install. The install is totally generic, and they only thing I add is KDE and SSH.
- log in and run uname -a. The output looks like:
Linux sdcc13 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux This part is a little confusing, but I think this means that this is a version 5 kernel, patch level 10 and sublevel 92. On kernel.org, I think the closest version is: longterm: 5.10.93 So, these are the commands I'm using: wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.93.tar.xz xz -cd linux*.tar.xz | tar xvf cd linux-5.10.93/ cp /boot/config-$(uname -r) .config sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison make -j11 sudo make modules_install sudo make install sudo reboot And then the reboot fails as described above. I do have to edit the .config to fix the CERT issue, but I don't change anything else. This seems incredibly generic, and it seems like it should work, so any help is appreciated. I've also tried make menuconfig , and make oldconfig as part of this process, but the result is the same. What am I missing? I finally got the Debian instructions to work (with a few added lines). So, to build the same kernel that's on a stock debian 11 system, here is what I did. The scariest part is that you have to remove the stock kernel, so better to have at least one different kernel before doing this: sudo apt-get install build-essential fakeroot sudo apt-get build-dep linux apt-get source linux cd linux-5.10.92/ fakeroot make -j10 -f debian/rules.gen binary-arch_amd64 sudo apt remove --purge linux-image-5.10.0-11-amd64-unsigned sudo dpkg -i linux-image-5.10.0-11-amd64-unsigned_5.10.92-1_amd64.deb sudo reboot Thanks for the help. | Kubuntu 21.10: All ports (open or closed) return ICMP admin-prohibited, even with no firewall enabled. How to fix? Posted: 27 Jan 2022 11:16 PM PST Running an up-to-date installation of Kubuntu 21.10. If I run any network service on the machine, I'm unable to reach it from anywhere else on my network. The error is always "Host unreachable". A tcpdump scan reveals the SYN packet does reach the host, but an ICMP "admin-prohibited" packet is immediately sent back. The packet never even reaches iptables (verified by adding a rule that would match a connection, and it's counter never increases) nmap is also unable to detect the port as open, however its scan does show up in the counter. nmap interprets the port as filtered because the prohibited packet is ICMP; no response to the SYN packet is sent. Here is the tcpdump output, on the host machine with a service actively listening on port 8000, that appears when another machine tries to connect: 04:43:09.154362 IP 192.168.1.3.56608 > 192.168.1.183.8000: Flags [S], seq 3664350430, win 64240, options [mss 1460,sackOK,TS val 2819866111 ecr 0,nop,wscale 7], length 0 04:43:09.154417 IP 192.168.1.183 > 192.168.1.3: ICMP host 192.168.1.183 unreachable - admin prohibited filter, length 68 Here is what happens when nmap scans: 04:44:49.060156 ARP, Request who-has 192.168.1.183 tell 192.168.1.3, length 46 04:44:49.060177 ARP, Reply 192.168.1.183 is-at 74:e6:e2:da:19:0f, length 28 04:44:49.156156 IP 192.168.1.3.33094 > 192.168.1.183.8000: Flags [S], seq 4114316293, win 1024, options [mss 1460], length 0 04:44:49.156260 IP 192.168.1.183 > 192.168.1.3: ICMP host 192.168.1.183 unreachable - admin prohibited filter, length 52 iptables is completely clear, ACCEPT policy on all default chains, no rules whatsoever on filter , nat and mangle . Services can be accessed locally using localhost or the machine's IP on the machine itself. The only issue is trying to access from the network. I do have Docker on the machine, but for trying to figure this out, I disabled Docker and removed all of its iptables rules and chains. If services are started as Docker containers, they are able to be reached from the network. But I am trying to run a service outside of a container. The machine also has VirtualBox installed, if that's relevant, but at the time of testing no VirtualBox machines were running. Also of important note is that the SSH server running on the host can be reached successfully - this is the only service that is reachable, regardless of what else is running: Starting Nmap 7.91 ( https://nmap.org ) at 2022-01-26 11:00 UTC Nmap scan report for 192.168.1.183 Host is up (0.00035s latency). Not shown: 65534 filtered ports PORT STATE SERVICE 22/tcp open ssh MAC Address: *redacted* Too many fingerprints match this host to give specific OS details Nmap done: 1 IP address (1 host up) scanned in 78.45 seconds Is there perhaps a kernel setting somewhere that is causing this to occur? Edit: As requested here is iptables-save output, but it's totally empty... # Generated by iptables-save v1.8.7 on Wed Jan 26 06:17:24 2022 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] COMMIT # Completed on Wed Jan 26 06:17:24 2022 # Generated by iptables-save v1.8.7 on Wed Jan 26 06:17:24 2022 *nat :PREROUTING ACCEPT [0:0] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] COMMIT # Completed on Wed Jan 26 06:17:24 2022 | clock_gettime error logging into VSFTP on Amazon Linux 2 from certain clients only Posted: 28 Jan 2022 12:24 AM PST We have an FTP server VSFTPD running on AWS Linux 2; users are chrooted. Some users can log on fine, others are getting connection failed in WinSCP and an error in Filezilla. On investigation, the error is: Relink /lib64/libnss_myhostname.so.2 with /lib64/librt.so.1 for IFUNC symbol clock_gettime Oddly, the exact same configuration which works for some clients fails for the others. This doesn't seems to be a common error and I would value ideas about how to fix it, either in the VSFTPD configuration or the clients. | Using two variables to form a single text file Posted: 28 Jan 2022 12:24 AM PST I am trying to create a text file with below content user name is ${name} and his mobile number is ${number} I have 10 users and 10 mobile numbers as well. User names are saved in user.txt and the contact number is saved in contact.txt . user.txt looks like below. apple cat tom contact.txt looks like below, 1234 3456 5678 my output should look like below. user name is apple and his mobile number is 1234 user name is cat and his mobile number is 3456 user name is tom and his mobile number is 5678 I want this output in single file. Could someone please help me with the shell and python script? | Make OS-dependent Requires section in an RPM spec file Posted: 28 Jan 2022 12:51 AM PST Situation I have an RPM that uses semanage (SELinux policy management tool) and restorecon (SELinux context configuration tool) in the post-installation and pre-uninstallation stages. Unfortunately, between RHEL 6/7 and 8, the package containing these tools was renamed from policycoreutils-python to policycoreutils-python-utils . A working spec file for the RHEL8 RPM contains: Requires(post): policycoreutils-python-utils Requires(preun): policycoreutils-python-utils And a working spec file for the RHEL6/7 RPM contains: Requires(post): policycoreutils-python Requires(preun): policycoreutils-python What I try to achieve I could live with the two spec files/two RPMs, one for every OS type, but I'm lazy and I want one spec that serves all. What I tried I read about the OS conditional %{rhel} , containing the OS version. The following should work, according to the RPM manual: %if %{rhel} < 8 Requires(post): policycoreutils-python Requires(preun): policycoreutils-python %endif %if %{rhel} == 8 Requires(post): policycoreutils-python-utils Requires(preun): policycoreutils-python-utils %endif If I check the value of the %{rhel} variable on my target systems, I get what I expect: centos7-system» rpm --eval '%{rhel}' 7 centos8-system» rpm --eval '%{rhel}' 8 Installation of this RPM on a CentOS 6/7 instance works fine. However, upon installation of the OS-independent RPM on an CentOS 8 instance, I get: centos8-system» dnf install my-1.26-0.x86_64.rpm <...> Error: Problem: conflicting requests - nothing provides policycoreutils-python needed by my-1.26-0.x86_64 Debug output: centos8-system» rpm -ivvvh my-1.26-0.x86_64.rpm 2>&1 | grep Requires D: Requires: /bin/bash YES (db files) D: Requires: /bin/sh YES (db files) D: Requires: /bin/sh YES (cached) D: Requires: /bin/sh YES (cached) D: Requires: /usr/bin/env YES (db files) D: Requires: /usr/bin/perl YES (db files) D: Requires: /usr/bin/php YES (db files) D: Requires: nagios-plugins NO D: Requires: perl(Getopt::Long) YES (db provides) D: Requires: perl(strict) YES (db provides) D: Requires: policycoreutils-python NO D: Requires: policycoreutils-python NO (cached) D: Requires: policycoreutils-python NO D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides) D: Requires: rpmlib(FileDigests) <= 4.6.0-1 YES (rpmlib provides) D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides) D: Requires: rpmlib(PayloadIsXz) <= 5.2-1 YES (rpmlib provides) It would seem that the Requires for the CentOS 6/7 scenario are used, and not those from the CentOS 8 scenario. What am I not seeing here? Is there anything I can do to debug this? Related and sources | Storage encryption on Linux desktop: LVM on LUKS or ZFS Posted: 27 Jan 2022 10:50 PM PST I choose solution for storage encryption on Linux desktop. For years LVM on LUKS was a best option with superior performance and reliability. But ZFS on Linux actively develops new functions and now we have options. I compared LVM on LUKS and ZFS with various fio tests with default encryption settings, provided by developers and mantainers: aes-xts-512b at LUKS, aes-256-gcm at ZFS. Here are average bandwidth and latency metrics at RAM block device for each volume type: At the first comparsion on the charts looks controversional. XTS obviously faster than GTC on random small blocks. But on sequentional reads and writes ZFS shows comparable latency with a noticeable increase in bandwidth! Which of these solutions is best suited for desktop tasks in terms of performance? Now I find it difficult to choose and I will be grateful for the advices. UPD1: For example, my typical storage tasks are: - Web browser loads: mixed reads & writes files near 100-1000 KB in local cache;
- Starting applications: random reads system binaries near 100-1000 KB;
- Compiling software: reads & writes hudge amount of small files;
- Storing archive like photos: mostly writes files up to 10 MB, rare reads;
- Serving huge files like UHD videos for home media: up to 100 GB sequetial writes or reads;
- And more.
It is easy to optimize system for each individual task. But which of the solutions best fit all of them? UPD2: And here is some real life measurements with files: | How to write a script that accepts input from stdin or a file? Posted: 27 Jan 2022 11:07 PM PST I have a bash driver for a awk script that should accept input as cat text.txt | driver.sh or ./driver.sh file1.txt file2.txt ... [filen.txt] for however many files. I have tried using read var gawk -f awk_prac.awk $var This works for piping only. I also tried using a for loop to read all the file names, but that doesn't work for piped text. Any input is appreciated. | sum rows and columns in a table of numbers Posted: 27 Jan 2022 11:43 PM PST I have large and many tables of numbers. Below is just a sample: A 25 27 50 B 35 37 75 C 75 78 80 D 99 88 76 I want to sum the rows and the columns in each table for further processing so the output look like this: A 25 27 50 102 B 35 37 75 147 C 75 78 80 233 D 99 88 76 263 234 230 281 How can I do it? I tried awk but did not work. | Can I use scp to copy files to the home directory without having to specify it? Posted: 27 Jan 2022 10:13 PM PST I've followed this tutorial to see how to use scp to transfer files to my server. And all is well. So I'm using commands like this: scp examplefile yourusername@yourserver:/home/yourusername/ But I'm wondering if there's a way for me to not have to specify the destination with the prepended /home/yourusername/ . I'm already using the username in the address, is there a way to make the home directory on the remote user the "base" of the file transfer destination? Or, to clarify, I want to be able to send files to the home directory of the user on the remote computer (yourusername@yourserver:/home/yourusername/ ) with a command like this: scp examplefile yourusername@yourserver Is it possible? Feasible? | Trying to connect bose quietcomfort 35 headset over bluetooth on arch linux Posted: 27 Jan 2022 10:05 PM PST There is another question here, but i followed those instructions and it still didn't work. Here is the systemctl status Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Bluetooth daemon 5.42 Oct 06 10:02:38 TRAYUSH systemd[1]: Started Bluetooth service. Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Starting SDP server Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Bluetooth management interface 1.12 initialized Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Failed to obtain handles for "Service Changed" characteristic Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Sap driver initialization failed. Oct 06 10:02:38 TRAYUSH bluetoothd[376]: sap-server: Operation not permitted (1) Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Failed to set mode: Not Supported (0x0c) Oct 06 10:03:00 TRAYUSH bluetoothd[376]: a2dp-sink profile connect failed for 04:52:C7:0E:7F:12: Protocol not available Oct 06 10:06:20 TRAYUSH bluetoothd[376]: a2dp-sink profile connect failed for 04:52:C7:0E:7F:12: Protocol not available Here are the contents of /etc/bluetooth/main.conf [General] ControllerMode=bredr And the contents of /etc/bluetooth/audio.conf [General] Enable=Source,Sink,Headset,Gateway,Control,Socket,Media Here is what happens when I try to connect via bluetoothctl [trash@TRAYUSH ~]$ bluetoothctl [NEW] Controller 98:58:8A:07:14:FC TRAYUSH [default] [NEW] Device 04:52:C7:0E:7F:12 QC35 [bluetooth]# power on Changing power on succeeded [bluetooth]# agent on Agent registered [bluetooth]# connect 04:52:C7:0E:7F:12 Here is the relevant information from /etc/pulse/default.pa ### Automatically load driver modules for Bluetooth hardware .ifexists module-bluetooth-policy.so load-module module-bluetooth-policy .endif .ifexists module-bluetooth-discover.so load-module module-bluetooth-discover .endif Any help is appreciated, thanks. Ninja Edit: Pulseaudio-bluetooth IS installed. | find and replace with the value in another file Posted: 28 Jan 2022 12:08 AM PST I have two files with different formats with columns tab spaced. I have to compare the columns column1 , column2 of file1 with file2 . If they matches, I need to replace the value in column6 of file1 with the value in column3 of file2 . I have tried using awk but I am not able to replace the value. Could you please advise on the below snippet ? awk 'FILENAME == ARGV[1] { m[$1,$2] = $6; next; } { if (($1,$2) in m) { m[$6]= $3; print m[$6]; } }' file1 file2 top few lines of file1 1201 12011 1 0 0 0 1 1202 12021 1 0 0 0 1 1203 12031 1 0 0 0 1 1204 12041 1 0 0 0 2 1207 12071 1 0 0 0 2 1209 12091 1 0 0 0 1 1210 12101 1 0 0 0 1 1212 12121 1 0 0 0 1 1213 12131 1 0 0 0 1 1214 12141 1 0 0 0 2 top few lines of file2 1201 12011 1 1202 12021 1 1203 12031 1 1204 12041 1 1206 NA 1 1207 12071 2 1208 NA 1 1209 12091 2 1210 12101 2 I want to assign the values from file2 to file1 column as I would like to write the updated content into another file out.txt edit Tried the below code as per the comments awk '{ if (FNR==NR) { a[FNR]=$1;b[FNR]=$2;c[FNR]=$3} else { if (a[FNR] == $1 && b[FNR] ==$2) { $6=c[FNR]} else {$6=$6}; print $0; } }' file2 file1 Got this output 1201 12011 1 0 0 1 1 1202 12021 1 0 0 1 1 1203 12031 1 0 0 1 1 1204 12041 1 0 0 1 2 1207 12071 1 0 0 0 2 1209 12091 1 0 0 0 1 1210 12101 1 0 0 0 1 1212 12121 1 0 0 0 1 1213 12131 1 0 0 0 1 1214 12141 1 0 0 0 2 | Use here-document in a one-liner? Posted: 27 Jan 2022 09:05 PM PST I have a simple script that executes commands on remote host using ssh and a here-document. I was trying to do it with a one-liner at command line but I couldn't figure out how to do the here-document outside of a script. Is it possible? I spent some time googling and reading documentation about here-documents, but it wasn't coming to me. This script works fine - I needed the here-document section in order to run awk remotely via ssh but I usually like to do one-liners for simple stuff: #!/bin/bash # it looks up all my hosts with 'db' in the name # then gets the PID of any rsyncs running as user 'research' # and pumps them into xargs getHosts=(`curl --silent "http://assetts.lab/all_hosts" | grep -v ^# | awk -F" " '{print$1}'|grep db`) for BOX in ${getHosts[@]};do echo "$BOX: " ssh -T sshUser@$BOX <<"EOF" ps -ef | egrep "rsync|iasync" | awk -F" " '{if ($1 ~ "research") print $2}'|sudo xargs -i ps -fp '{}' #ps -ef | egrep "rsync|iasync" | awk -F" " '{if ($1 ~ "research") print $2}'|sudo xargs -i kill '{}' EOF echo done I'm probably missing something simple... Anyway thanks for any suggestions :) | Get a progress indicator when importing MySQL databases Posted: 28 Jan 2022 12:17 AM PST I often import MySQL databases, and this can take a while. There is no progress indicator whatsoever. Can one be shown, somehow? Either records imported, MB imported, or tables imported... anything is better than just waiting. Anybody any idea? I use this command: mysql -uuser -p -hhost database < largefile.sql Files are between 40-300 MB, and the host is within the local network. | |
OSCHINA 社区最新专区文章 Posted: 27 Jan 2022 10:53 AM PST 2022年1月国产数据库排行榜:TiDB霸榜两年势头不减,openGauss与OceanBase分数大涨 Posted: 26 Jan 2022 09:31 PM PST 奎钩粲粲光华动,群玉森森气象新。国产数据库行业在经历了2021年的躬行实践之后,产品、服务、生态等取得了蓬勃发展。从2022年1月份的[国产数据库流行度排行榜](https://www.modb.pro/dbRank?0127)上,我们可以看到,相较于去年12月份,榜单上又增加了新成员。目前,共有194家数据库参与排名。排行榜前十五名的数据库中,... | PostgreSQL 实现定时任务的四种方法 Posted: 25 Jan 2022 01:45 AM PST 文章转载自公众号:SQL编程思想 数据库定时任务可以用于实现定期的备份、统计信息采集、数据汇总、数据清理与优化等。PostgreSQL 没有提供类似 Oracle、MySQL 以及 Microsoft SQL Sever 的内置任务调度功能,因此本文给大家介绍一下 PostgreSQL 数据库中实现定时任务的 4 种方法。 方法一:操作系统定时任务 Linux 定时任... | 把复杂交给我们,把简单还给你丨TiVP 让 SQL 执行计划可视化 Posted: 26 Jan 2022 06:24 PM PST > 通过 TiDB Hackathon 重新认识了自己的潜力。当你想做一件事情,你会发现自己特别专注在上面,然后一些你觉得不会成功、不可能的事情也会变得可能。 > > ——TiVP 团队 在刚刚结束的 TiDB Hackathon 2021 赛事中,TiVP 赛队的作品 TiDB Visual Plan 实现了 SQL 执行计划的可视化,有利于快速定位及解决执行计划相关的各... | Redis:我是如何与客户端进行通信的 Posted: 23 Jan 2022 10:51 PM PST 摘要:我是一个Redis服务,最引以为傲的就是我的速度,我的 QPS 能达到10万级别。 本文分享自华为云社区《Redis:我是如何与客户端进行通信的》,作者: 码农参上 。 江湖上说,天下武功,无坚不摧,唯快不破,这句话简直是为我量身定制。 我是一个Redis服务,最引以为傲的就是我的速度,我的 QPS 能达到10万级别。 在我... | 第三方测评:GaussDB(for Redis)稳定性与扩容表现 Posted: 25 Jan 2022 06:42 PM PST 摘要:本文将通过采用Redis Labs推出的多线程压测工具memtier_benchmark对比测试下GaussDB(for Redis) 和原生Redis的特性差异 本文分享自华为云社区《墨天轮评测:GaussDB(for Redis)稳定性与扩容表现》,本文转载自墨天轮。 GaussDB(for Redis) 是华为云推出的企业级Redis,采用计算存储分离架构,兼容Redis生态的云原生... | |
OSCHINA 社区最新专区文章 Posted: 27 Jan 2022 09:21 AM PST Hotspot GC研发工程师也许漏掉了一块逻辑 Posted: 04 Aug 2020 11:50 PM PDT > 本文来自: [PerfMa技术社区](https://club.perfma.com) > > [PerfMa(笨马网络)官网](https://www.perfma.com) ## 概述 今天要说的这个问题,是我经常面试问的一个问题,只是和我之前排查过的场景有些区别,属于另外一种情况。也许我这里讲了这个之后,会成为不少公司JVM必问之题,所以本文还是值得大家好好看看的,相信... | 剖析CWE视图的层次定义和解析方式 Posted: 25 Jan 2022 02:33 AM PST 摘要:CWE做为软件缺陷分类的重要标准, 对安全研究、安全标准、缺陷管理起了重要的纽带作用。CWE通过编号的类型(类缺陷、基础缺陷和变种缺陷等)形成了多层次的缺陷类型划分体系。本文进一步剖析了CWE视图的层次之间的定义和解析方式。 本文分享自华为云社区《CWE视图层级关系的解析 之 CWE节点的存储和定义》,作者:U... | 高并发环境下,6个构建缓存服务需要注意的问题 Posted: 26 Jan 2022 12:00 AM PST 摘要:高并发环境下如何构建缓存服务,你知道吗? 本文分享自华为云社区《【高并发】高并发环境下构建缓存服务需要注意哪些问题?》,作者:冰 河。 缓存特征 (1)命中率:命中数/(命中数+没有命中数) (2)最大元素(空间):代表缓存中可以存放的最大元素的数量,一旦缓存中元素的数量超过这个值,或者缓存数据所占的... | 带你十天轻松搞定 Go 微服务系列(九、链路追踪) Posted: 26 Jan 2022 06:48 PM PST ## 序言 我们通过一个系列文章跟大家详细展示一个 go-zero 微服务示例,整个系列分十篇文章,目录结构如下: 1. 环境搭建 2. 服务拆分 3. 用户服务 4. 产品服务 5. 订单服务 6. 支付服务 7. RPC 服务 Auth 验证 8. 服务监控 9. **链路追踪(本文)** 10. 分布式事务 期望通过本系列带你在本机利用 Docker 环境利用 go-z... | PhpStorm 2021.3.2 RC 已发布 Posted: 26 Jan 2022 03:43 PM PST PhpStorm 2021.3.2 的候选发布版本现已可用,该版本带来如下变更: 修复:[IDEA-286810] 调用 File->New 后 CMD+N 快捷方式未打开生成对话框 (MacOS) 修复:[WEB-53199] MUI material 组件中的字符串联合类型没有属性值自动补全 修复:[WEB-53966] Stylus:CSS 属性值的补全功能不可用 修复:[IDEA-285766] Git 分支弹出... | Laravel framework 8.81.0 发布,Laravel 框架核心库 Posted: 26 Jan 2022 03:28 PM PST Laravel framework 包含 PHP 框架 Laravel 的核心代码,目前更新了 8.81.0 版本,主要更新内容如下: 新增 添加 Illuminate/Support/Stringable::scan()(#40472) 允许在返回对象的虚拟属性访问器中禁用缓存 ( #40519 ) 添加了更好的按位运算符支持(#40529) 在集合上添加了 getOrPut ( #40535 ) 改进 PhpRedis 刷新逻... | ModStartCMS 模块化万能建站系统 v3.1.0 API 接口支持,小程序上线 Posted: 26 Jan 2022 07:52 AM PST ModStart 是一个基于 Laravel 模块化极速开发框架。模块市场拥有丰富的功能应用,支持后台一键快速安装,让开发者能快的实现业务功能开发。 系统完全开源,基于 Apache 2.0 开源协议,免费且不限制商业使用。 ModStartCMS发布v3.1.0版本,新功能和Bug修复累计8项,API接口支持,小程序上线。 2022年01月26日ModStartCMS... | SparkSQL的入门实践教程 Posted: 26 Jan 2022 12:50 AM PST 摘要:Spark SQL是用于处理结构化数据的模块。与Spark RDD不同的是,Spark SQL提供数据的结构信息(源数据)和性能更好,可以通过SQL和DataSet API与Spark SQL进行交互。 本文分享自华为云社区《【SparkSQL笔记】SparkSQL的入门实践教程(一)》,作者:Copy工程师。 1.Spark SQL概述 Spark SQL是用于处理结构化数据的模块... | Oauth2 password 模式认证成功后 请求头并没有能获取到 token的值 Posted: 26 Jan 2022 12:01 AM PST 如图 认证后 SpringSecurity Oauth2 已经返回了 token值 但是在其他接口进行请求的时候 没能正确获取到 显示 undefined undefined 如图 另外如果我想接口地址 不是走服务的主机 而是通过网关转发(网关会对加密的token进行解密 接口需要使用解密的token)需要怎么弄 (使用了 Knife4jAggregation 中间件)... | hdfs——nn的启动优化 Posted: 24 Jan 2022 07:19 AM PST 【概述】 上一篇文章讲解了,在一定DN节点规模,一定block数据量下的并发写文件的优化问题。 在这种节点、数据量规模的集群中,当HDFS全部重启(nn+dn全部重启),或者两个NN都重启后,需要经过较长时间,才能真正对外提供服务。 那么nn启动过程中都干了些啥,主要耗时点在哪,以及应当如何优化,本文就来聊聊这些问题—... | 带你十天轻松搞定 Go 微服务系列(八、服务监控) Posted: 25 Jan 2022 09:20 PM PST ## 序言 我们通过一个系列文章跟大家详细展示一个 go-zero 微服务示例,整个系列分十篇文章,目录结构如下: 1. 环境搭建 2. 服务拆分 3. 用户服务 4. 产品服务 5. 订单服务 6. 支付服务 7. RPC 服务 Auth 验证 8. **服务监控(本文)** 9. 链路追踪 10. 分布式事务 期望通过本系列带你在本机利用 Docker 环境利用 go-z... | |
OSCHINA 社区最新专区文章 Posted: 27 Jan 2022 08:37 AM PST CPU是如何执行程序的 | a = 1 +2 在CPU中发生了什么? Posted: 26 Jan 2022 03:45 AM PST **1. CPU 是如何执行程序的?** 代码写了那么多,你知道 a = 1 + 2 这条代码是怎么被 CPU 执行的吗? 不知道也不用慌张,接下来就循序渐进的、一层一层的攻破这些问题。 **图灵机的工作方式** 图灵机长什么样子呢?你从下图可以看到图灵机的实际样子: ![](https://oscimg.oschina.net/oscnet/up-2426d2a0aac9015099b15... | 凡泰极客荣获2021 InfoQ“最佳技术产品营销奖” Posted: 26 Jan 2022 12:16 AM PST 近日,由全球技术社区InfoQ发起的合作伙伴年度盛典线上活动成功举办。大会聚焦技术内容生产、技术社区活跃、技术产品营销以及技术发展趋势等维度,针对企业或用户颁发了多个奖项。 ![在这里插入图片描述](https://img-blog.csdnimg.cn/img_convert/dd1cb6ae1fb2a9e07111437694b93419.png#pic_center) **凡泰极客凭借领先... | |
Recent Questions - Stack Overflow Posted: 27 Jan 2022 08:26 AM PST Recent Questions - Stack Overflow .gitignore not ignoring previously commited file in subdirectory despite *.<fileending> Posted: 27 Jan 2022 08:26 AM PST After having forgotten to include it in my .gitignore file, the file 'Labb1.mpf' was accidentally commited and sent upstream. Afterwards I added the line '*.mpf' into my gitignore file, but the file still showed up under 'Untracked Files' when I ran git status and became staged when I used 'git add .'. It was still in untracked files even after a commit which removed the file upstream. Labb.mpf is in a subdirectory with this structure: C:. │ .gitignore | └───Labb1 │ Labb1.mpf I eventually managed to make it not get included in 'git add .' by specifically writing out the full pathname in the gitignore file. Labb1/Labb1.mpf If I comment out this line and only run '*.mpf', the file become staged with the git add command again. This is a solution in a way, but I don't know why and it is not a very elegant solution for a problem that may very well come up in other circumstances. Do anyone have any ideas as to how to use the asterisk command to successfully ignore, in this case, .mpf files? I have tried with both one and two asterisks. | how to set property custom control to be from beginning Posted: 27 Jan 2022 08:26 AM PST I created custom control (textbox) and I'm trying to make some validation on it I'm using syncfusion textbox control so: #1: there is (NearImage) property to set image inside the textbox but when I added the code in Onpaint event but I don't see the image, how to set that property to be from the beginning? #2: how check (IsRequired ) property always not just when I leave the textbox? public partial class Jo_TextBox : TextBoxExt { #region Constructor public Jo_TextBox() { InitializeComponent(); this.ThemesEnabled = false; this.BackColor = Color.WhiteSmoke; this.BorderStyle = BorderStyle.Fixed3D; this.Border3DStyle = Border3DStyle.Flat; this.Font = new Font("Tahoma", 10F); this.ForeColor = Color.FromArgb(64, 64, 64); this.TextAlign = HorizontalAlignment.Center; this.RightToLeft = RightToLeft.Yes; this.MaxLength = 50; this.Size = new Size(250, 24); }
| OSCHINA 社区最新专区文章 Posted: 27 Jan 2022 08:07 AM PST 一键强制删除k8s集群中所有Delete状态的pv Posted: 27 Jan 2022 12:23 AM PST kubectl get pv|grep Delete| awk '{print $1}'| xargs kubectl delete pv --force --grace-period=0 这个命令有可能还是删不掉,那就再来一个 kubectl get pv|grep Delete| awk '{print $1}'| xargs kubectl patch pv -p '{"metadata": {"finalizers": null}}'... | 消息队列 RocketMQ 遇上可观测:业务核心链路可视化 Posted: 21 Jan 2022 03:03 AM PST *作者:文婷、不周* > **引言:** 本篇文章主要介绍 RocketMQ 的可观测性工具在线上生产环境的最佳实践。RocketMQ的可观测性能力领先业界同类产品,RocketMQ 的 Dashboard 和消息轨迹等功能为业务核心链路保驾护航,有效应对线上大规模生产使用过程中遇到的容量规划、消息收发问题排查以及自定义监控等场景。 ## 消息队列... | 服务网格在联通的落地实践 Posted: 25 Jan 2022 10:16 PM PST 【百度云原生导读】2020年联通集团确定了以 Kubernetes(以下简称K8s)为资源调度平台的架构演进路线,与之相对的应用微服务架构也需基于 K8s。中国联合网络通信有限公司软件研究院(以下简称 联通软研院)在微服务技术进行了长期的技术研究开发与应用实践。期间,收获了微服务为联通生产建设带来的红利,也因需要支撑多... | 一键强制删除k8s集群中所有Terminating状态的pod Posted: 25 Jan 2022 04:10 PM PST kubectl get po --all-namespaces|grep Terminating| awk '{print $1"\t"$2}'| xargs -l bash -c 'kubectl delete po $1 -n $0 --force --grace-period=0' | kubectl 如何给node打roles Posted: 25 Jan 2022 12:17 AM PST [root@pi4-master01 ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION pi4-master01 Ready master 67d v1.18.20 pi4-node01 Ready 48d v1.18.20 pi4-node02 Ready node 66d v1.18.20 [root@pi4-master01 ~]# kubectl label node pi4-node01 node-ro... | 【监控体系】最全面系统的Zabbix讲解 | 含源码&监控类型整理 Posted: 23 Jan 2022 11:08 PM PST 主讲人:王鸿杰,云智慧/企业效能部/架构师 讲师简介:云智慧架构师,PHP/PECL 开发组成员,PECL/SeasClick、PECL/SeasLog Maintainer。6 年研发经验,2018 年加入透视宝团队,致力于 APM 产品的架构与研发,专注于服务的性能分析与优化。2021 年加入效能工程团队,为高效而生,立足于使用最少的资源来解决最大的问题,研... | | OSCHINA 社区最新专区文章 Posted: 27 Jan 2022 06:48 AM PST JuiceFS 在理想汽车的使用和展望 Posted: 19 Jan 2022 11:13 PM PST 理想汽车是中国新能源汽车制造商,设计、研发、制造和销售豪华智能电动汽车,于 2015 年 7 月创立,总部位于北京,已投产的自有生产基地位于江苏常州,通过产品创新及技术研发,为家庭用户提供安全及便捷的产品及服务。 在中国,理想汽车是成功实现增程式电动汽车商业化的先锋,首款及目前唯一一款商业化的增程式电动汽车... | | Recent Questions - Server Fault Posted: 27 Jan 2022 03:56 AM PST AWS Tag Editor - Region "Africa (Cape Town)" not available in list of regions? Posted: 27 Jan 2022 03:25 AM PST In the Tag Editor (Resource Groups & Tag Editor) you can select the applicable regions in the "Select regions" dropdown. Most of the AWS regions are there, but I do not see af-south-1 which is "Africa (Cape Town)". I tried my best to find information about this in the AWS documentation, but so far no luck. If anyone could elaborate on this, that would be greatly appreciated. | How to identify which MSI installation is in progress that throw the error message : "Another program is being installed." Posted: 27 Jan 2022 03:09 AM PST We're building Automation deployment through Ansible that have several .msi to install. And we encountered, rather randomly the following error message during deployment : Another program is being installed. Please wait until that installation is complete, and then try installing this software again. Our goal is to trigger a retry time out whenever this occur and provide a logging message that will describe what is most likely provoking this error. We don't want to reboot the server or force-kill any in-progress installation. I found some leads to explore to identify which process is causing this TLDR; I'm looking for a consistent reproductible way of checking what is actually throwing this error 1) The msiexec.exe process The common answer to this question on Google is to check the Task manager for a msiexec.exe process and kill it before restarting the install. This is not an alternative for this case. 2) There seems to be a Registry key that says whether or not there is an installation in progress HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\InProgress But I couldn't find any trace of this key in the registry of several windows machine (we tried refreshing it while installing and uninstalling .msi) 3) In the services.msc GUI there is a WindowsInstaller Service that has no state at rest : This service got into the Running state when we triggered an MSI installation, but it then never went out of this state even several minutes after the msi was finished. 4) On going Windows Updates Another common lead found out there is that on going Windows Update are preventing any other .msi to be installed Is there a consistent way to automate the checking of this ? | nginx 404 .php extension with fpm Posted: 27 Jan 2022 03:08 AM PST When I visit a non-existent url with .php extension I get a ngnix 404 error page, however url without .php extension it works as expected using the try_files. Where the 404 is handled via php application. It has happened since I added this code as suggested fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } Reason for adding this was to fix error in logs: FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream This error was happening when I visited non-existent.php file. I read lots of posts about the problem being to do with 'SCRIPT_FILENAME' being missing but this wasn't the case for me. example.conf server { listen 443 ssl; listen [::]:443 ssl; server_name example.com; root /var/www/example/public/public; access_log /var/log/nginx/example.access.log main_ext; error_log /var/log/nginx/example.error.log warn; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; include /etc/nginx/include.d/ssl.conf; # Laravel rewrite ^/index.php/(.*) /$1 permanent; location = / { try_files /page-cache/pc__index__pc.html /index.php?$query_string; } location / { try_files $uri $uri/ /page-cache/$uri.html /index.php?$query_string; } location ~ [^/]\.php(/|$) { include /etc/nginx/include.d/php.conf; fastcgi_pass unix:/var/run/php/php8.0-fpm-example.sock; } } php.conf # Check file exists try_files $uri =404; # https://www.nginx.com/nginx-wiki/build/dirhtml/start/topics/examples/phpfcgi/ fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_index index.php; # Mitigate https://httpoxy.org/ vulnerabilities fastcgi_param HTTP_PROXY ""; fastcgi_intercept_errors off; # include the fastcgi_param setting include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; Example URL: https://example.com/foo - Works fine shows pretty 404 inside php app. https://example.com/foo.php - Shows default ngnix 404. | kvm and libvirt: hotplug virtual disk as USB storage Posted: 27 Jan 2022 02:27 AM PST | microk8s: pod resource usage metrics not available from all nodes Posted: 27 Jan 2022 02:25 AM PST I am running microk8s v1.22/stable on a Linux cluster with 11 nodes. I have enabled the metrics-server plugin and installed Prometheus via the Helm chart with nodeExporter and kubeStateMetrics enabled. I get all sort of other metrics, but I have noticed that pod metrics (e.g., container_cpu_usage_seconds_total ) are available for pods running on just one of the nodes. I didn't notice anything special about this node. I have tried disabling and re-enabling the metrics-server plugin and added spec.template.spec.hostNetwork: true to the metrics-server deployment as suggested elsewhere, but to no avail. Here's the result of running microk8s status : $ microk8s status microk8s is running high-availability: yes datastore master nodes: ... datastore standby nodes: ... addons: enabled: dns # CoreDNS ha-cluster # Configure high availability on the current node ingress # Ingress controller for external access metrics-server # K8s Metrics Server for API access to service metrics storage # Storage class; allocates storage from host directory disabled: .... What could I be missing and what should I check? | Apache server is very slow for high traffic Posted: 27 Jan 2022 01:18 AM PST I am using Apache 2 on AWS ec2 instance. I have application load balancer with 2 instances/servers attached to it. Each instance type is m5.8XLarge. My application is developed in Laravel, I am using RDS. I am having 300,000 visitors per day and 10,000 visitors at a time. My website is very slow and initial server response time is very high upto 8 sec. Note: I can not use autoscalling because my contents are dynamic, and changing frequently. Autoscaling is using old IMG. I am having below extra settings on httpd.conf file MaxKeepAliveRequests 500 Keepalive On KeepAliveTimeout 5 HostnameLookups Off <IfModule prefork.c> StartServers 5 MinSpareServers 20 MaxSpareServers 40 MaxClients 200 MaxRequestsPerChild 4000 </IfModule> How i can improve the server speed and allow apache to handle much load/visitors | What path on disk does a containerd snapshot key map to? Posted: 27 Jan 2022 12:12 AM PST I want to remove a snapshot from a node in our Kubernates cluster: /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/NNNN But I am unable to map this path to any snapshots as reported by ctr -n k8s.io snapshots list . I have tried the usage command, but the INODE does not seem to map to the NNNN entry in the snapshots directory, because the "usage" list is not a subset of the entries in the directory. Is there a way to understand if snapshot/NNNN is in use? | Wildfly double proxy nginx Posted: 27 Jan 2022 02:03 AM PST I have a Cloudflare VM with Ubuntu, where I have Wildfly installed and NGINX, which will be used as reverse proxy. (When I configure my home DNS server to points to this VM and use domain, everything works as it should -> classic reverse proxy setup) Problem is, when I try to setup DNS domain which I have at cloudflare, which I also point to the same Ubuntu server with wildly and nignx, it doesn't work OK, because I enabled Proxy option on DNS at cloudflare to hide IP. Does thing configuration works or even makes sense? | Windows 10 configured with RAW discs to increase Hyper V performance takes minutes to boot Posted: 26 Jan 2022 11:48 PM PST Long story short: If I configure discs on the machine as a RAW partition so Hyper V works directly with them to increase performance then the machine takes minutes to boot with the blue circle going in rounds. If I put the discs offline then it boots in seconds. Any ideas on how to avoid this? | How to define www.*.abc.example.com wildcard domain in nginx server block? Posted: 26 Jan 2022 11:37 PM PST I want to define my own domain something like this - www..abc.example.com in nginx server blocks . i have tried to do like this - www(.).abc.example.com * & it throws error like - nginx: [emerg] invalid server name or wildcard "www(.*).abc.example.com" on 0.0.0.0:443 | DKIM: Can I safely add a DomainKey policy record without breaking existing email? Posted: 26 Jan 2022 11:26 PM PST I need to setup DKIM to validate an email provider we are using. In the provider's documentation, they require us to add two records, a selector record and a policy record, like this: selector._domainkey.mydomain.com TXT "k=rsa; p=mykeyhere" _domainkey.mydomain.com TXT "t=y; o=~" I'm concerned about adding this new policy, because we have quite a few DKIM selectors setup in our DNS zone already, with no existing policy record (we use multiple third party providers that need to send email on our behalf). I want to make sure I don't break existing functionality by creating this record. From what I've read, you can only have a single policy per zone, so it is "shared", so to speak. I've researched this a bit, and the policy the vendor is requiring, t=y; o=~ , should be pretty harmless. It seems to say some emails may be signed, and to treat verified/unverified emails in the same way (reference). Still, this would impact our production application, and I'm hoping to get some confidence that this is safe to add. Am I correct in my assumption that I can add this record without causing a bunch of our outbound email to be marked as spam? Or am I missing something? | Set two IP addresses for parallel data transfers Posted: 27 Jan 2022 12:31 AM PST I need to transfer massive amounts of data to my server from different client systems around the world as fast as possible. My organisation has two redundant lines from different service providers (150 Mbps + 150 Mbps) which are not used at night. They are mapped to different public IP addresses. I have been given permission to use both lines in parallel to get the maximum possible throughput. How do I configure the network settings (on my server) for a 2nd parallel connection? (I'm on CentOS). I'm using a java based file transfer tool (fdt) that transfers data over sockets. The client (uploading the data) will run this tool on their system by specifying a public IP address (corresponding to Provider 1 or 2). This public IP is mapped to a private IP address on my server (by our company firewall/router). This works well. However, I now want the client to run two instances of the tool - one for each provider (thereby doubling the transfer bandwidth). We have two public IP addresses (one corresponding to each provider). So on my side (on the CentOS server), I have created another private IP address, and asked our IT team to map the 2nd public IP to that. There will be two fdt instances running in server-mode on my server. I need each one to receive data from the respective client instances I tried adding the 2nd IP address as an alias, with netmask = 255.255.255.255 but unable to ping it. What is the right way to achieve this. | How to force disconnect from Windows Remote Apps command line Posted: 26 Jan 2022 11:46 PM PST I have a RDP connection that is initiated by a RD Gateway website. Login and everything works well. But sometimes the connection becomes a ghost, or if i want to login as another user on the same RD Gateway via RDP i have to manually press the Disconnect from all connection/apps Does anyone know how i get the that disconnect function by command line? The connection does not appear in Query Uers for example | Cant't acces to localhost mysql server. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' Posted: 27 Jan 2022 02:14 AM PST I have inherited an ubuntu machine with mysql installed and I don't know how. My problem is that i can't access to mysql. Here some info of my host: cat /etc/os-release NAME="Ubuntu" VERSION="20.04.1 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.1 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal MySQl version mysql Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) This is error message: $ mysql -u root -p ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' --- $ service mysqld start Failed to start mysqld.service: Unit mysqld.service not found. This file /var/run/mysqld/mysqld.sock dosn't exist. EDIT WITH MORE INFO $ netstat -tlpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 99/systemd-resolved tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 136/sshd: /usr/sbin tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 303/master tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 313/sshd: root@pts/ tcp6 0 0 :::80 :::* LISTEN 138/apache2 tcp6 0 0 :::22 :::* LISTEN 136/sshd: /usr/sbin tcp6 0 0 ::1:25 :::* LISTEN 303/master tcp6 0 0 ::1:6010 :::* LISTEN 313/sshd: root@pts/ $ systemctl start mysql Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. $ systemctl status mysql.service * mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2022-01-27 08:32:50 CET; 10s ago Process: 5687 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Process: 5696 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE) Main PID: 5696 (code=exited, status=1/FAILURE) Status: "Server startup in progress" Error: 2 (No such file or directory) Jan 27 08:32:50 osticket systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE Jan 27 08:32:50 osticket systemd[1]: mysql.service: Failed with result 'exit-code'. Jan 27 08:32:50 osticket systemd[1]: Failed to start MySQL Community Server. Jan 27 08:32:50 osticket systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5. Jan 27 08:32:50 osticket systemd[1]: Stopped MySQL Community Server. Jan 27 08:32:50 osticket systemd[1]: mysql.service: Start request repeated too quickly. Jan 27 08:32:50 osticket systemd[1]: mysql.service: Failed with result 'exit-code'. Jan 27 08:32:50 osticket systemd[1]: Failed to start MySQL Community Server. $ pwd && ls /var/log alternatives.log apache2 auth.log.4.gz dpkg.log.1 lastlog mysqld.err php7.4-fpm.log.2.gz php7.4-fpm.log.8.gz syslog.3.gz wtmp alternatives.log.1 apt btmp dpkg.log.2.gz mail.log php7.4-fpm.log php7.4-fpm.log.3.gz php7.4-fpm.log.9.gz syslog.4.gz wtmp.1 alternatives.log.2.gz auth.log btmp.1 dpkg.log.3.gz mail.log.1 php7.4-fpm.log.1 php7.4-fpm.log.4.gz private syslog.5.gz alternatives.log.3.gz auth.log.1 dist-upgrade dpkg.log.4.gz mail.log.2.gz php7.4-fpm.log.10.gz php7.4-fpm.log.5.gz syslog syslog.6.gz alternatives.log.4.gz auth.log.2.gz dmesg faillog mail.log.3.gz php7.4-fpm.log.11.gz php7.4-fpm.log.6.gz syslog.1 syslog.7.gz alternatives.log.5.gz auth.log.3.gz dpkg.log journal mail.log.4.gz php7.4-fpm.log.12.gz php7.4-fpm.log.7.gz syslog.2.gz ubuntu-advantage.log $ cat /var/log/mysqld.err 2022-01-26T12:23:07.952718Z 0 [ERROR] [MY-010083] [Server] --verbose is for use with --help; did you mean --log-error-verbosity? 2022-01-26T12:23:07.952814Z 0 [ERROR] [MY-010095] [Server] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files 2022-01-26T12:23:07.953735Z 0 [ERROR] [MY-010119] [Server] Aborting I have tried to fix it in many ways but I can't. Someone could help me? Thanks. | Possible exposable asset type on Google Cloud Posted: 27 Jan 2022 02:25 AM PST One of the ways to secure a cloud environment is to monitor all of the assets that we have. Recently, I made a script to get information regarding those assets by using GCP API, but I need to do it one by one, for each asset by using the describe command to determine if it is public or not. Do you know which asset type on Google Cloud that can be publicly accessible? I found some but I want to make sure that I cover every asset type that can be public. Here is what I found: - Bucket
- Instance
- Firewall
- Forwarding Rule
- Backend Service
- Cluster
- Storage
Is there anything else that I missed? or is there a way to get all information regarding public asset on GCP? | What is causing BadRequestException when calling the ExecuteStatement operation on Aurora Serverless db Posted: 27 Jan 2022 01:06 AM PST I have a lambda function that retrieves records from AWS Aurora Serverless db. Now I thought of adding api gateway to trigger the lambda function but I get this error Connect an AWS Lambda function triggered by API Gateway to Aurora Serverless MySQL database. [ERROR] BadRequestException: An error occurred (BadRequestException) when calling the ExecuteStatement operation: Access denied for user 'admin'@'10.x.xx.xxx' (using password: YES); Error code: 1045; SQLState: 28000 Traceback (most recent call last): File "/var/task/index.py", line 11, in handler sql="SELECT * FROM ecomdev.Customer;" What is causing BadRequestException when calling the ExecuteStatement operation on Aurora Serverless db. I have used AWS CDK to create the stacks. I went through this question But it follows a different which I feel is not necessary. Please help me out if you have encountered this error. | Why is there a ping difference between AWS Lightsail and EC2? Posted: 27 Jan 2022 01:01 AM PST I've recently made a CS:GO server in AWS Lightsail under the Mumbai region. Its ping keeps spiking at random times and it's not only the case with me but all my friends. Meanwhile, EC2 stays stable and never spikes. I've also attached screenshots for a public service measuring the ping delay for the Mumbai region in both Lightsail and EC2. Lightsail ping results for Mumbai region EC2 ping results for Mumbai region Why does this difference occur when both are in the same region and both are created by AWS? Is there no way to make it work in Lightsail and I have to shift to EC2? | Sendmail does not masquerade the hostname.domain combination Posted: 26 Jan 2022 11:39 PM PST My MASQUERADE settings looks as follows... dnl # Also accept email sent to "localhost.localdomain" as local email. dnl # LOCAL_DOMAIN(`localhost.localdomain')dnl dnl # dnl # The following example makes mail from this host and any additional dnl # specified domains appear to be sent from mydomain.com dnl # MASQUERADE_AS(`wantedomain.com')dnl dnl # dnl # masquerade not just the headers, but the envelope as well dnl # FEATURE(masquerade_envelope)dnl dnl # dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well dnl # FEATURE(masquerade_entire_domain)dnl dnl # MASQUERADE_DOMAIN(localhost)dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl MASQUERADE_DOMAIN(localhost02.ux.com.tus)dnl MASQUERADE_DOMAIN(localhost02)dnl dnl MASQUERADE_DOMAIN(mydomain.lan)dnl My hosts file contains... 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.101.129 localhost02.ux.com.tus localhost02 [root@localhost02 mail]# hostname -s localhost02 [root@localhost02 mail]# hostname -f localhost02.ux.com.tus [root@localhost02 mail]# When I'm trying to send a mail, sendmail keeps try to send this with localhost02.ux.com.tus and does not take into account the MASQUERADING settings (I'm expecting user@wantedomain.com as the sender)... [root@localhost02 mail]# mail dzsordzs.kluni@heretofind.com Subject: TEST Hello World. . EOT [root@localhost02 mail]# mailq /var/spool/mqueue (1 request) -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient----------- 20JB4OZi054827* 13 Wed Jan 19 12:04 <user@localhost02.ux.com.tus> <dzsordzs.kluni@heretofind.com> Total requests: 1 Any help would be much appreciated! 20222.01.27 - UPDATE I have created a short shell script, containing the followings... #!/bin/sh RECIPIENT=dzsordzs.kluni@heretofind.com SENDER=user@wantedomain.com /usr/sbin/sendmail -i -v -Am -f$SENDER $RECIPIENT <<END Subject: TEST From: $SENDER Hello World. END After executing the shell script, I still get a time out error from the SMTP server... [root@localhost02 mail]# ./sendmail.sh dzsordzs.kluni@heretofind.com... Connecting to email-smtp.eu-central-1.amazonaws.com. port 587 via relay... dzsordzs.kluni@heretofind.com... Deferred: Connection timed out with email-smtp.eu-central-1.amazonaws.com. [root@localhost02 mail]# mailq /var/spool/mqueue (6 requests) -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient----------- 20R7JX1b017298 13 Thu Jan 27 08:19 user@wantedomain.com (Deferred: Connection timed out with email-smtp.eu-central-1.) dzsordzs.kluni@heretofind.com However telnet connection to the server via port 587 looks OK... [root@localhost02 mail]# telnet email-smtp.eu-central-1.amazonaws.com 587 Trying 172.27.1.14... Connected to email-smtp.eu-central-1.amazonaws.com. Escape character is '^]'. 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-B4HOZL4HF JJQ6jMD4ztoBhcmitWhE 451 4.4.2 Timeout waiting for data from client. Connection closed by foreign host. [root@localhost02 mail]# ...and finally the content of the /var/log/maillog file... Jan 27 08:19:33 localhost02 sendmail[17298]: 20R7JX1b017298: from=user@wantedomain.com, size=57, class=0, nrcpts=1, msgid=<202201270719.20R7JX1b017298@localost02.ux.com.tus>, relay=root@localhost Jan 27 08:25:33 localhost02 sendmail[17298]: 20R7JX1b017298: to=dzsordzs.kluni@heretofind.com, ctladdr=user@wantedomain.com (0/0), delay=00:06:00, xdelay=00:06:00, mailer=relay, pri=30057, relay=email-smtp.eu-central-1.amazonaws.com. [18.158.92.82], dsn=4.0.0, stat=Deferred: Connection timed out with email-smtp.eu-central-1.amazonaws.com. | How do I Generate a Bearer Token for cURL to Get Thru IAP (GCP)? Posted: 27 Jan 2022 12:33 AM PST I need to cURL a web app hosted behind IAP on GCP. Normally, users log in through IAP and use the web app, but I need to run some cURL commands (interactive and non-interactive) that hit the web app URLs (for example: https://myapp.com/get_pics/1) I cannot figure out how to get a Bearer token from GCP that I can use in the authorization header for cURL. I can set up a service account with "IAP Secured Web App User" role and I have the JSON key for this service account, but I am not sure where to go after that to get a proper Bearer token that IAP will accept. | PowerDNS: spoof NXDOMAIN response from "forward-zones" server and forward it Posted: 27 Jan 2022 02:25 AM PST I faced an issue trying to setup PowerDNS for my local network. I have a domain example.com managed by Cloudflare. For instance I have A record on Cloudflare like server.example.com pointing to 1.1.1.1 but my local clients should resolve server.example.com to 10.10.10.1 and it's not a problem by using forward-zones="example.com=127.0.0.1:54"; in recursor config, but I have another record like mail.example.com pointing to 2.2.2.2 , that server is outside of my local network and I have to copy A record from Cloudflare to my local PowerDNS by hands otherwise local client gets NXDOMAIN. Looks like I need to spoof NXDOMAIN response from local PowerDNS and query forwarder. Is it possible? EDIT: I started with LUA script and is able to catch NXDOMAIN response. But I can't forward it. function nxdomain(dq) pdnslog("Intercepting NXDOMAIN for: "..dq.qname:toString()) if dq.qtype == pdns.A then dq.rcode=0 -- make it a normal answer dq:addAnswer(pdns.A, "10.10.10.10") return true end return false end | why doesn't arp-scan find any devices when nmap does? Posted: 27 Jan 2022 12:58 AM PST When I run nmap -sn 192.168.0.0/24 I get the result: Nmap scan report for 192.168.0.1 Host is up (0.16s latency). Nmap scan report for 192.168.0.103 Host is up (0.19s latency). Nmap scan report for 192.168.0.124 Host is up (0.11s latency). Nmap done: 256 IP addresses (3 hosts up) scanned in 124.31 seconds Though when I run arp-scan 192.168.0.0/24 (the default interface is the one I'm targeting) I get: Interface: wlp6s0, datalink type: EN10MB (Ethernet) Starting arp-scan 1.9.5 with 256 hosts (https://github.com/royhills/arp-scan) 0 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.9.5: 256 hosts scanned in 1.986 seconds (128.90 hosts/sec). 0 responded Why does nmap detect devices on the local network and arp-scan doesn't? Is my arp-scan not working (broken in some way), or am I missing something? The local network is enabled by an old d-link router. | How to Retain Proxy URL for all request using Apache load balancer Posted: 27 Jan 2022 02:07 AM PST I am trying to serve the requests to my Site through Proxy machine using Load balancer. When i try to access the Site by hitting http://PROXYSERVER.com, the HomePage comes up fine retaining the address bar URL with http://PROXYSERVER.com. Now, when i try to access internal links for example, http://PROXYSERVER.com/services/ then the address bar URLchanges to the APPSERVER URL http://APPSERVER01.com/services/ NOTE: The Page comes up fine but the address bar URL is getting changed. Expected behaviour is when user requests http://PROXYSERVER.com/services/ then the address bar should retain the proxy URL while serving the request Here is my code for load balancing, ProxyRequests off ServerName PROXYSERVER.com # WebHead1 BalancerMember http://APPSERVER01:80/ route=node1 # WebHead2 BalancerMember http://APPSERVER02:80/ route=node2 Order Deny,Allow Deny from none Allow from all ProxySet lbmethod=byrequests #ProxySet lbmethod=bybusyness ProxySet stickysession=BALANCEID SetHandler balancer-manager Order deny,allow Allow from all # Point of Balance ProxyPass /balancer-manager ! ProxyPass / balancer://mycluster/ Any suggestions will be appreciated. | nginx points the sub-directory of an alias folder to the base directory Posted: 27 Jan 2022 01:05 AM PST I am new to Nginx. Now I have a confusion on nginx configurations: My web site contains folders in different locations: location / { root /Path1; } location ^~ /download { alias /Path2; } When I query http://mysite/download , I am accessing the content of /Path2 instead of /Path1 Now I want to add a sub-directory under download containing my private files, and I want to add password protection. So I add: location /download/personal { auth_basic "Admin Login"; auth_basic_user_file Path_to_htpasswd; } But I got 404 error when querying http://mysite/download/personal after key in my credentials. According to nginx error log, I am directed to /Path1/download/personal , which does not exist. How can I configure nginx, such that all access to http://mysite/download/* will be directed to the same directory in /Path2 ? Update: I may find a solution: just put the sub-directory configuration in the parent conf: location ^~ /download { alias /Path2; location /download/personal { auth_basic "Admin Login"; auth_basic_user_file Path_to_htpasswd; } } Is it correct? Or are there better solutions? | Unable to install Certificate Enrolment Policy Web Service Posted: 27 Jan 2022 12:04 AM PST I'm running on Windows 2k8 Enterprise edition, and when adding the Active Directory Certificate Services, I don't see the option to add the Certificate Enrolment Policy Web service in the dialog box. Please let me know if I'm doing something wrong. Thanks! | MySQL tmp tables: how to clean up diskspace after killing a copying to tmp table process? Posted: 27 Jan 2022 12:04 AM PST i ran out of disk space while running an alter table on a large table. I restarted MySQL afterwards and checked the MySQL tmp dir. A show status like '%tmp%' lists 5 tmp files and 4 tmp tables. A df still shows 99% disk usage (was like 72% before the alter table). Running a "check table" returns "OK". How to clean up the disk space used by the alter table command? I'm running MySQL 5.5.31 on Ubuntu 12.04. Thanks: Lars | Cloudwatch alarms from Amazon AWS EC2 instance are always in UT, how can I change the alarm time zone to Eastern? Posted: 27 Jan 2022 02:35 AM PST I am running an Amazon linux AMI and the alarms that I've setup are coming in all showing UT (universal time). It is inconvenient reading these alarms and I'd like them setup to read in eastern time zone (or America/New_York). I've already set my /etc/localtime to point to -> /usr/share/zoneinfo/America/New_York ln -s /usr/share/zoneinfo/America/New_York /etc/localtime But it is still sending alarms in the UT timezone. Does anyone have a solution to this? | Amazon EC2 instance missing Network Interface Posted: 27 Jan 2022 03:11 AM PST I am running Linux on a t1.micro instance at Amazon EC2. Once I noticed bruteforce ssh login attemtps from a certain IP, after litle Googling I issued the two following commands (other ip): iptables -A INPUT -s 202.54.20.22 -j DROP iptables -A OUTPUT -d 202.54.20.22 -j DROP Either this, or maybe some other actions like yum upgrade perhaps, caused the follwing fiasco: after rebooting the server, it came up without the Network Interface! I only can connect to it through AWS Management Console JAVA ssh client - via local 10.x.x.x address. Console's Attach Network Interface as well as Detach.. are greyed out for this instance. Network Interfaces item at the left does not offer any Subnets to choose from, to create a new N.I. Please advice, how can I recreate a Network Interface for the instance? Upd. The instance is not accessible from outside: cannot be pinged, SSH'ed or connected by HTTP on port 80. Here's the ifconfig output: eth0 Link encap:Ethernet HWaddr 12:31:39:0A:5E:06 inet addr:10.211.93.240 Bcast:10.211.93.255 Mask:255.255.255.0 inet6 addr: fe80::1031:39ff:fe0a:5e06/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1426 errors:0 dropped:0 overruns:0 frame:0 TX packets:1371 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:152085 (148.5 KiB) TX bytes:208852 (203.9 KiB) Interrupt:25 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) What is also unusual: a new micro instance I created from scratch, with no relation to the troubled one, was not pingable too. | How to change Windows DFS replication log file path? Posted: 27 Jan 2022 02:07 AM PST I have enabled DFS replication for a couple shares on my Windows Server 2003 machine and it works fine, except that I would like the debug logs to be written to a different drive (it logs in to the windows folder on the C drive by default) and also change the logging levels so it's not logging as much. I found some information here at technet (see the section titled DFS replication) and a couple other sites with similar information. The problem is, I do not have the registry keys (HKLM\SYSTEM\CurrentControlSet\Services\Dfsr\Parameters) - I do not have the "Dfsr" container. Also, if I try the wmi command (wmic /namespace:\root\microsoftdfs path dfsrmachineconfig set debuglogseverity=5) it says invalid namespace 0x8004100e. I do have a "dfs" container at that registry path (dfs instead of dfsr) and \Parameters, but none of the registry keys mentioned on that technet site. How can I change the path and/or log level? | SQL 2005/2008 and sp_add_jobstep fails Posted: 27 Jan 2022 01:05 AM PST I have a job that is being created by a non-sysadmin user. This job fails because the @database_user_name setting with the error "Only a sysadmin can specify '@database_user_name' parameter" If I read BOL this would be ignored in SQL 2008 R2 which I have confirmed I am running with @@version . Any thoughts? EXECUTE @ReturnCode = msdb.dbo.sp_add_jobstep @job_id = @JobID, @step_id = 1, @step_name = N'Delete From TmpEmployee', @command = N'Delete From TmpEmployee', @database_name = @Database, @server = N'', @database_user_name = N'', @subsystem = N'TSQL', @cmdexec_success_code = 0, @flags = 0, @retry_attempts = 0, @retry_interval = 1, @output_file_name = N'', @on_success_step_id = 2, @on_success_action = 4, @on_fail_step_id = 0, @on_fail_action = 2 IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback | | Recent Questions - Stack Overflow Posted: 27 Jan 2022 03:12 AM PST How hard is learning Java script (for web dev. , react) [closed] Posted: 27 Jan 2022 03:11 AM PST I know average c++. and some data structures. i dont know much about class , structure etc. ON a scale of 1 to 10 how hard it will be. | Python drama with variable Posted: 27 Jan 2022 03:11 AM PST in python I have this set of variable variable.py #--------------Project 1--------------# ip_server = '10.10.55.98 username = 'user_1' distro = 'debian' #--------------Project 2--------------# ip_server = '10.10.55.96' username = 'user_2' distro = 'opensuse' #--------------Project 3--------------# ip_server = '10.10.55.95' username = 'user_3' distro = 'ubuntu' In the script main.py I just want to import variable of Project 2, how to this? main.py from variable import * ho_to_import_variable_of_project2? thanks to all for answers anche time to dedicate my question | In android studio Card view is going out of screen on my phone . But while developing , on emulator it is working perfectly responsive and fine Posted: 27 Jan 2022 03:11 AM PST My Cardview is completely responsive on Emulator but while running in phone it is going in left screen side . I used constraint layout in my whole app. I used view pager and tab layout and i am showing this layout on View Pager . I tried a lot but this layout is not responsive on any phone but on Emulator it is <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="212dp"> <androidx.cardview.widget.CardView android:id="@+id/cardView" android:layout_width="match_parent" android:layout_height="212dp" android:layout_marginStart="2dp" android:layout_marginTop="3dp" android:layout_marginEnd="2dp" app:cardBackgroundColor="#FFFFFF" app:cardCornerRadius="3dp" app:cardElevation="2dp" app:cardMaxElevation="2dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/main_image_url" android:layout_width="140dp" android:layout_height="140dp" app:layout_constraintBottom_toBottomOf="@+id/main_description" app:layout_constraintEnd_toStartOf="@+id/main_title" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/main_title" tools:srcCompat="@tools:sample/avatars" /> <TextView android:id="@+id/main_title" android:layout_width="220dp" android:layout_height="70dp" android:layout_marginTop="16dp" android:layout_marginEnd="5dp" android:ellipsize="end" android:fontFamily="@font/fira_sans_medium" android:maxLines="3" android:padding="2dp" android:text="Title displayes here lslsll ajajja alalal aayya ahahha akakaka oaoaooas ssssjsjs sjsjjs ssjjsjsjs sjsjjsjs ssshshhs jsjsjsssssjsjsjsjsjsjsjjsjsjs" android:textColor="@color/black" android:textSize="17sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="@+id/main_description" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/main_description" android:layout_width="220dp" android:layout_height="80dp" android:layout_marginTop="10dp" android:layout_marginEnd="5dp" android:ellipsize="end" android:fontFamily="@font/fira_sans_light" android:maxLines="4" android:padding="2dp" android:text="Description jsjsjsjjsjsjsj jajajajja sosososoosos shshshshss shhshshhshs shshshhs saiiaiaaia sbsbbsbsb aoaoaoao sjsjsjs akakaDescription jsjsjsjjsjsjsj jajajajja sosososoosos shshshshss shhshshhshs shshshhs saiiaiaaia sbsbbsbsb aoaoaoao sjsjsjs akaka" android:textColor="#000000" android:textSize="14sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@+id/main_title" /> <TextView android:id="@+id/main_source_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="64dp" android:fontFamily="monospace" android:text="Source_ID" android:textColor="@color/black" android:textSize="10sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/share" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/main_image_url" /> <TextView android:id="@+id/main_pubDate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="32dp" android:text="Update Date" android:textColor="@color/black" android:textSize="10sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toEndOf="@+id/share" app:layout_constraintTop_toBottomOf="@+id/main_description" app:layout_constraintVertical_bias="0.409" /> <ImageView android:id="@+id/share" android:layout_width="18dp" android:layout_height="18dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/main_pubDate" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toEndOf="@+id/main_source_id" app:layout_constraintTop_toBottomOf="@+id/main_description" app:srcCompat="@drawable/share" /> </androidx.constraintlayout.widget.ConstraintLayout> </androidx.cardview.widget.CardView> </androidx.constraintlayout.widget.ConstraintLayout> | group by json array based on combine multiple keys taking too much time Posted: 27 Jan 2022 03:11 AM PST I have below json array I want to group by it based on sourceno and destno combine key. json array:- [ { "sourceno": "112", "destno": "321", "edno": "123", "eppno": "322" }, { "sourceno": "112", "destno": "321", "edno": "123", "eppno": "324" }, { "sourceno": "114", "destno": "335", "edno": "100", "eppno": "355" }, { "sourceno": "114", "destno": "335", "edno": "222", "eppno": "999" } ] Present Code:- let pobj={} let p_data=[] let count=0; for(key in eddarr) { let resultarr=eddarr[key] let pkey = eddarr[key].sourceno+'-'+eddarr[key].destno; let obj = {}; let isNew = true; if(pdata.length > 0){ for(let j=0;j<pdata.length;j++){ if(pdata[j].hasOwnProperty(pkey)){ pdata[j][pkey][pdata[j][pkey].length] = resultarr; isNew = false; break; } } } if(isNew){ obj[pkey] = new Array(); obj[pkey][0] = resultarr; pdata.push(obj); } console.log(pdata) Above code is working fine and i am getting below result but its running very slow its creating below result for 37K records after 15 min. How can i optimise this code or any other logic need to build. I want to process 15 lac records but loop is taking too much time.thanks in advance Final result after processing should be like this:- [ { "112-321": [ { "edno": "123", "eppno": "322" }, { "edno": "123", "eppno": "324" } ] }, { "114-335": [ { "edno": "100", "eppno": "355" }, { "edno": "222", "eppno": "999" } ] } ] | primeng v11.2.0: p-columnFilter not showing Posted: 27 Jan 2022 03:10 AM PST Dear all I am using the p-table component from primeNG library: the main filter (highlighted input box) is working but when I click on the funnel next to the 'Sample' nothing happens and no error is showing in the console. I am expecting something similar to the following: Here is my code: <p-table #dt1 id="graphData" [value]="graphData" dataKey="sample" [rows]="6" [showCurrentPageReport]="true" [rowsPerPageOptions]="[6,10,25,50]" [loading]="loading" styleClass="p-datatable-gridlines" [paginator]="true" currentPageReportTemplate="Showing {first} to {last} of {totalRecords} entries" [globalFilterFields]="['sample','tyre_pressure','speed','power']"> <ng-template pTemplate="caption"> <div class="flex"> <button pButton label="Clear" class="p-button-outlined" icon="pi pi-filter-slash" (click)="clear(dt1)"></button> <span class="p-input-icon-left ml-auto"> <i class="pi pi-search"></i> <input #filterName pInputText type="text" (input)="dt1.filterGlobal($event.target.value, 'contains')" placeholder="Search keyword" /> </span> </div> </ng-template> <ng-template pTemplate="header"> <tr> <th> <div class="flex justify-content-center align-items-center"> Sample <p-columnFilter type="text" field="graphData.sample" display="menu"> </p-columnFilter> </div> </th> <th> <div class="flex justify-content-center align-items-center"> Tyre Pressure <p-columnFilter type="number" field="tyre_pressure" display="menu"> </p-columnFilter> </div> </th> The text filter in p-columFilter is not showing when I press the funnel button: <th> <div class="flex justify-content-center align-items-center"> Sample <p-columnFilter type="text" field="graphData.sample" display="menu"> </p-columnFilter> </div> </th> What am i missing? | skip the line in json generated through php Posted: 27 Jan 2022 03:10 AM PST Hello I am currently working on a project with file generation with Json it works fine. But I'm facing a problem it mounts the Json in a single line as shown in the image. I would like it to be one below the other as in the following example I tried to use \n but I didn't have a positive result it didn't work my code below is this header('Content-disposition: attachment; filename=DadosKDL.json'); header('Content-type: application/json'); $query ='SELECT * from ite'; $result = mysqli_query($banco, $query); if (!$result) { echo("Error description: " . mysqli_error($banco)); } $i=0; while ($row = mysqli_fetch_array($result)){ $nserlum=$row['nserlum']; $nsercon=$row['nsercon']; $hora=$row['hora']; $posts[] = array('ITEM 1 '=> $nserlum, 'ITEM 2 '=> $nsercon, 'ITEM 3'=> $hora); } $fp = fopen( 'php://output', 'w'); fwrite($fp, json_encode($posts)); fclose($fp); mysqli_close($banco); | Progress Bar with data Posted: 27 Jan 2022 03:10 AM PST I was looking to code a progress bar which is linked with data. For example if a student answers a certain amount of questions the progress bar goes up. How would I go about this? I can code the progress bar. I don't know what to use for the data and how to link it. | xorriso fails extracting iso from curl through pipe Posted: 27 Jan 2022 03:10 AM PST I have an .iso that should be downloaded and "extracted" to a directory. I figured I could do this same as tar using stdin or bash process substitution to extract while downloading, but I'm getting errors that the file is empty. Running the curl command standalone downloads the .iso as expected. $ osirrox -drive-class clear_list caution -indev <( curl --fail --header "X-JFrog-Art-Api: $(cat /run/secrets/ARTIFACTORY_API_KEY)" https://artifactory.corp.int/application.iso ) -extract / application -file_name_limit 255 > #10 0.331 xorriso 1.4.8 : RockRidge filesystem manipulator, libburnia project. > #10 0.331 > #10 0.333 Drive current: -indev '/dev/fd/63' > #10 0.333 Media current: stdio file, sequential > #10 0.333 Media status : is blank > #10 0.333 Media summary: 0 sessions, 0 data blocks, 0 data, 1024g free Not sure whether it's curl or xorriso giving me a hard time. Possibly related; I cannot make it work with 7z either (process substitution or -si ). Not as interested in a 7z solution since it among other things drops execute permissions, but the info might be useful for finding a root cause. | AlertDialog with EditText and Three buttons Posted: 27 Jan 2022 03:10 AM PST So i have tis code and i'm trying to create a AlertDialog with an EditTet and Three buttons the positive one, the négative one and the neutral one , but it doesn't work and the application stops b5.setOnClickListener(new View.OnClickListener() { @SuppressLint("UseCompatLoadingForDrawables") @Override public void onClick(View view) { AlertDialog.Builder boite; boite = new AlertDialog.Builder(MainActivity.this); boite.setTitle("boite de dialogue"); boite.setIcon(getDrawable(R.drawable.warning_shield_96px)); final EditText input = new EditText(MainActivity.this); input.setInputType(InputType.TYPE_CLASS_TEXT); boite.setView(input); boite.setPositiveButton("OUI", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { //whatever action } }); boite.show(); boite.setNegativeButton("NON", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { //whatever action } }); boite.show(); boite.setNeutralButton("CANCEL", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { //whatever action } }); boite.show(); } }); | Cannot get remote stream when using Kurento Utils Posted: 27 Jan 2022 03:10 AM PST I have a video-call-chat website using WebRTC. I built it with express, socket.io and kurento. Specifically, I run kurento server at port 8888: docker run -d -p 8888:8888 kurento/kurento-media-server:6.6.0 and I use Kurento Utils JS in client for: get Peer connection, transfer video streams, ICE candidates as well as handle offers, answers. I run my app on https://localhost:3000. In the client of local user, I use WebRtcPeerSendonly to send and embedded local MediaStream. And with remote users, they will receive and embedded the received MediaStream by method WebRtcPeerRecvonly. But the received MediaStream is always wrong and user can't embedded exact remote stream of the others. Can someone help in resolving this issue? Below is my code: user.rtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerRecvonly( options, function (err) { if (err) { return console.error(err); } this.generateOffer(onOffer); } ); user.rtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendonly( options, function (err) { if (err) { return console.error(err); } this.generateOffer(onOffer); } ); I have took a look at Kurento Utils JS library and I find out that it has two functions to get and assign remote stream: one is getRemoteStreams() and another is setRemoteVideo(). Below is the code: if (!pc.getRemoteStreams && pc.getReceivers) { pc.getRemoteStreams = function () { var stream = new MediaStream(); pc.getReceivers().forEach(function (sender) { stream.addTrack(sender.track); }); return [stream]; }; } function setRemoteVideo() { if (remoteVideo) { remoteVideo.pause(); var stream = pc.getRemoteStreams()[0]; console.log(stream) remoteVideo.srcObject = stream; logger.debug("Remote stream:", stream); if ( typeof AdapterJS !== "undefined" && AdapterJS.webrtcDetectedBrowser === "IE" && AdapterJS.webrtcDetectedVersion >= 9 ) { remoteVideo = attachMediaStream(remoteVideo, stream); } else { remoteVideo.load(); } } } When if condition come false, it mean the default getRemoteStreams function of this library is applied, I try to console.log the remote stream in library and it always show a MediaStream with ID = "default":
MediaStream {id: 'default', active: true, onaddtrack: null, onremovetrack: null, onactive: null, …} active: true id: "default" onactive: null onaddtrack: null oninactive: null onremovetrack: null But when I remove if condition, means that the getRemoteStreams function is overridden as above. Then the log show that remote stream is a MediaStream with a specified , for example: MediaStream {id: 'a1ece389-bac6-4263-83a8-e142f7137efb', active: true, onaddtrack: null, onremovetrack: null, onactive: null, …} active: true id: "a1ece389-bac6-4263-83a8-e142f7137efb" onactive: null onaddtrack: null oninactive: null onremovetrack: null But in this case, the received ID doesn't coincide with the sended MediaStream ID. I think the reason is not server connection because when new user access this website, it create a new ID (showed in console) and it can send Media Stream to the others (but not the expected one). | __str__ returned non-string (type Category). when I add post from admin Posted: 27 Jan 2022 03:11 AM PST After I added user and date_added in the Photo models, when I add post from admin its throws me an error saying: str returned non-string (type Category), when I click on the addpost link in the home template its throw another error: 'tuple' object has no attribute 'name'. how can I solve that ? the models.py: from django.db import models from cloudinary.models import CloudinaryField from django.contrib.auth.models import User # Create your models here. class Category(models.Model): name = models.CharField(max_length=100, null=False, blank=False) def __str__(self): return self.name class Photo(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) category = models.ForeignKey(Category, on_delete=models.SET_NULL, null=True, blank=True) image = CloudinaryField('image') description = models.TextField(null=True) date_added = models.DateTimeField(auto_now_add=True) def __str__(self): return self.category the view.py file: def home(request): category = request.GET.get('category') if category == None: photos = Photo.objects.all() else: photos = Photo.objects.filter(category__name=category) categories = Category.objects.all() context = {'categories': categories, 'photos': photos} return render(request, 'home.html', {'categories': categories, 'photos': photos} ) def viewPhoto(request, pk): photo = Photo.objects.get(id=pk) return render(request, 'photo.html', {'phpto': photo}) class PostCreativeView(LoginRequiredMixin, CreateView): model = Photo, Category fields = ['description', 'image', 'category', 'name'] template_name = 'post_create.html' def form_valid(self, form): form.instance.user = self.request.user return super (PostCreativeView, self).form_valid(form) | Which objects have the EventTarget interface? Posted: 27 Jan 2022 03:10 AM PST according to MDN Element, and its children, as well as Document and Window are EventTargets. What does its children mean? Since I can't add events to text nodes, right? Thanks and Greetings | Seach and comment all matches Posted: 27 Jan 2022 03:11 AM PST Is there a way to comment all the matches when doing CTRL+F or CTRL+R? I have tried a quick fix, but this is not working properly when the line to be printed is in different lines: # print("Hello" "World") I am using Python 3.7 and PyCharm 2021.3.1 | Is it possible to make LazyRow/LazyColumn display a certain amount of items on the screen without passing in an explicit DP width Posted: 27 Jan 2022 03:10 AM PST Is there a way to make a LazyRow/Row display for example 2 items on the screen simultaneously without measuring the screen width manually and passing the DP width to the children of the LazyRow? Current setup example: LazyRow( modifier = Modifier .fillMaxWidth() .height(200.dp) ) { item { FirstItem( modifier = Modifier.width( ScreenUtils.getScreenWidthDP(LocalContext.current) / columnCount ) ) } item { SecondItem( modifier = Modifier.width( ScreenUtils.getScreenWidthDP(LocalContext.current) / columnCount ) ) ) } } | Why do we use square brackets inside len()? Posted: 27 Jan 2022 03:10 AM PST I am new to Python and I am trying to understand why we use the square brackets inside the len() function: def counts(txt): return len([letter for letter in txt.lower() if letter in "aeiou"]) If I remove the square brackets, I get TypeError: object of type 'generator' has no len() but I don't understand what that means. | Why is there an unnecessary or operation when inverting bytes? Posted: 27 Jan 2022 03:11 AM PST I am really confused by this, however trivial it may be. Here's an example (which I tried on paper): uint16_t val = 32; //00000000 00100000 uint16_t swapped = val >> 8; //00100000 00000000 uint16_t swapped2 = val << 8; //00100000 00000000 uint16_t swapped3 = (val >> 8) | (val << 8); //00100000 00000000 I may be missing something... But as far as I know, they all have the same value, I was wondering maybe the operation in "swapped3" was a safeguard/good practice when doing the same for unsigned 32 bit values, but it wouldn't make sense. I've tried to search answers online, but all operations are either this or a play on it. Enlighten me, if possible, binary operations make my head spin. | How to download data in zip using Angular with nested folders [duplicate] Posted: 27 Jan 2022 03:11 AM PST I have following json "data":[ { "Name":"Mary ", "Email":"Mary.test@yahoo.com", "Phone_No":"1234567890","Birthdate":"1983-02-04", "Photo":"data:.....", //image data url "SerialNo":1, "updatedAt":"2022-01-24 12:41:57","createdAt":"2022-01-24 12:39:52", }, { "Name":"John ", "Email":"John.test@yahoo.com", "Phone_No":"1234567890","Birthdate":"1985-02-04", "Photo":"data:.....", //image data url "SerialNo":2, "updatedAt":"2022-01-24 12:41:57","createdAt":"2022-01-24 12:39:52", } ] I want to download this data in zip folder(sample.zip) Folder structure should be like this. how to create photo folder? I am trying following code, it downloads 3 files data.xls, 1.jpeg, 2.jpeg. now i want the folder structure downloadData(data: any){ let userData: any = []; let tokenData: any = {}; for (let key in data) { if (key.toLocaleLowerCase().includes('photo') ) { const image = element.data[key]; const imageName = `${element['SerialNo']}.jpeg`; tokenData[key] = imageName; const link = document.createElement('a'); link.href = image; link.download = imageName; link.click(); } else { tokenData[key] = element.data[key]; } } userData.push(tokenData); } this.exportJsonAsExcelFile(userData, `sample`); } private exportJsonAsExcelFile(json: any[], excelFileName:string): void { const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json); const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] }; const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' }); this.saveAsExcelFile(excelBuffer, excelFileName); } private saveAsExcelFile(buffer: any, fileName: string): void { const data: Blob = new Blob([buffer], { type: EXCEL_TYPE }); FileSaver.saveAs(data, fileName + EXCEL_EXTENSION); } | SQL query to return ids that only signed up but didn't take any other action Posted: 27 Jan 2022 03:11 AM PST I have an event table that looks like this. | id | event | date | |----|---------|------------| | 1 | sign up | 28/01/2022 | | 1 | log in | 29/01/2022 | | 1 | delete | 30/01/2022 | | 2 | sign up | 31/01/2022 | | 3 | log in | 01/02/2022 | | 4 | sign up | 02/02/2022 | | 4 | NULL | 03/02/2022 | I want to write a query that selects distinct ids that only signed up and did not carry out any other event. Thanks. | Extract Title Tags BeautifulSoup Posted: 27 Jan 2022 03:11 AM PST I need help because I wanted to write a Code for finding out title tags on a website. Although I used the code from another question and applied it to this scenario, there is no title tags whenever I print 'Beschreibung' from bs4 import BeautifulSoup import requests import pandas as pd import urllib.parse webseite = 'https://www.entega.de/sitemap/' response = requests.get(webseite) response.status_code soup = BeautifulSoup (response.content, 'html.parser') result_container = soup.find_all('div', {'class':'clearfix'}) url_part_1 = 'https://www.entega.de/sitemap/' url_part_2 = [] for item in result_container: for link in item.find_all ('a', {'class':'modSitemap__lvl1Link ui-link' }): url_part_2.append (link.get ('href')) url_joined = [] for i in url_part_2: url_joined.append (urllib.parse.urljoin(url_part_1,i)) Überschrift= [] Beschreibung= [] Verlinkungen = [] for link in url_joined: response = requests.get (link) soup = BeautifulSoup (response.content, 'html.parser') Beschreibung.append(soup.find_all('a', title=True, class_='modSitemap__lvl1Link ui-link')) | Google Analytics notification_receive Report 'not set' problem Posted: 27 Jan 2022 03:11 AM PST I am trying to report the notifications I send via Fcm using google analytics. However, most of the data appear to be not set. I can't find the reason for this. | Windbg alias replacement broken? Simplified example Posted: 27 Jan 2022 03:11 AM PST Yesterday I asked a question about the behavior of windbg aliases (Strange behavior of windbg alias in loops) and got some helpful answers. Now I have a simplified example that shows the behavior I am seeing, without any loops. It seems like alias replacement is simply broken, and the documentation about .block {} is basically wrong. In a foo.windbg script I have the following: ;aS ${/v:foo} 1 al .block { .echo foo } I run the script with $$><foo.windbg If the alias foo is not defined before running the script (or if it is already defined to 1), this works as expected. However if I already have foo defined to a different value, e.g. 0 ;aS ${/v:foo} 0 then when I run the script foo gets set to 1 (I can see that from the al command in the script) but the command .echo foo in the script produces 0. Even the reference to foo is in a .block{}. It works if the closing curly brace in the block statement is immediately after the reference to foo ;aS ${/v:foo} 1 al .block { .echo foo} This doesn't help because it means you can't use the alias unless it happens to be at the end of a .block{} or other compound statement. I though referencing the alias with ${foo} would help but it does not. From the answers to my previous question I see that deleting (ad) the alias before setting it seems to fix the problem in some cases. Just using ad foo will error out the script if foo is not defined so I can't use it. Using ad * works but deletes all aliases including ones I have already created and want to use. I tried .if (${/d:foo}) {ad ${/v:foo}} but that gives the same behavior, where foo is replaced with the old value when used further down in the script. So I guess the work-around is to start the script with aS ${/v:foo} dummy ad ${/v:foo} which seems to work. So the basic problem is that alias replacement fails (in some cases) unless the alias name is followed by the closing curly brace of certain statements like .block. All the examples from the windbg documentation just so happen to do exactly this, and/or delete all aliases first and work around the problem that way. I know I'm beating the dead horse but does this behavior have an explanation? Am I confused? It seems simply broken and, for the way I want to use aliases, useless. Thanks, Dave | Clone new object of old object without old reference in C# Posted: 27 Jan 2022 03:10 AM PST I have a huge object with a lot of attributes and child objects. Because of a poorly designed database which I can't control, I need to find matching objects in allCourses with the attribute CourseType = "SVYE" . For those who matches the condition, I want to change all values from "SVYE" to "SVYR" instead and add them to the original object allCourses . I realized that when you declare svCourse you still have the old references in courses which will cause all objects with the value on CourseType = "SVYR" . Instead of every match should be one with CourseType = "SVYE" and one with CourseType = "SVYR" . How could I create a copy of the matching values without having the reference to allCourses in the new var svCourses without declaring every attribute again? new Course(){ name = a.name // etc.. } My code: var svCourses = allCourses.Where(x => x.Occasions .Any(y => y.CourseType.Equals("SVYE"))) .ToList(); foreach(var svCourse in svCourses) { foreach(var o in svCourse.Occasions) { o.CourseType = "SVYR"; } allCourses.Add(svCourse); } return allCourses; | Python pandas decrease backfill until reach a certain number based on interval Posted: 27 Jan 2022 03:11 AM PST I have the following dataframe called df, date flag1 flag2 flag3 flag4… 2020-12-31 2021-01-01 2021-01-02 1 2021-01-03 2021-01-04 2021-01-05 1 2021-01-06 1 2021-01-07 2021-01-08 2021-01-09 2021-01-10 2021-01-11 1 1 2021-01-12 I want to do a backfill when a 1 appears in any column, and fill backwards until a number appears or failing that, backfill til a set number. So let's say the set number to reduce o to is 0 and the decrement is 0.1, it should look like this, date flag1 flag2 flag3 flag4… 2020-12-31 0.5 0.8 0.4 2021-01-01 0.0 0.6 0.9 0.5 2021-01-02 0.1 0.7 1.0 0.6 2021-01-03 0.2 0.8 0.7 2021-01-04 0.3 0.9 0.8 2021-01-05 0.4 1.0 0.9 2021-01-06 0.5 1.0 2021-01-07 0.6 0.6 2021-01-08 0.7 0.7 2021-01-09 0.8 0.8 2021-01-10 0.9 0.9 2021-01-11 1.0 1.0 2021-01-12 Can this be achieved with pandas? I want to be able to set the decrement amount and the limit for example the above would be 0.1 and 0. I know that this command can increment the values backwards, df1 = df1[::-1].fillna(method='ffill') (df1 + (df1 == df1.shift()).cumsum()).sort_index() But that's not what I want. | Flutter - How to compress image to display thumbnail? Posted: 27 Jan 2022 03:10 AM PST I am making a flutter app which loads about 700+ image from Cloud Storage through Firebase. Though, I am using pagination, the app still crashes sometimes on low end devices(does not crash on emulator). I have already compressed all my images, still sometimes it crashes. Is there a way to compress images when we load them from firestore to display only low quality thumbnails. It's a wallpaper app. So what I want to do is, display low quality images when loading all of them to reduce work load on the device and then use the original quality when setting them as wallpaper. | Linear Dependence of Set of Vectors in numpy Posted: 27 Jan 2022 03:11 AM PST I want to check whether some vectors are dependent on each other or not by numpy, I found some good suggestions for checking linear dependency of rows of a matrix in the link below: How to find linearly independent rows from a matrix I can not understand the 'Cauchy-Schwarz inequality' method which I think is due to lack of my knowledge, however I tried the Eigenvalue method to check linear dependency among columns and here is my code: A = np.array([ [0, 1, 0, 0], [0, 0, 1, 0], [0, 1, 1, 0], [1, 0, 0, 1] ]) lambdas, V = np.linalg.eig(A) print(lambdas) print(V) and I get: [ 1. 0. 1.61803399 -0.61803399] [[ 0. 0.70710678 0.2763932 -0.7236068 ] [ 0. 0. 0.4472136 0.4472136 ] [ 0. 0. 0.7236068 -0.2763932 ] [ 1. -0.70710678 0.4472136 0.4472136 ]] My question is how can I know that which columns of matrix A has eigen values 0? | Extract all inherited types / base list of ClassDeclarationSyntax Posted: 27 Jan 2022 03:11 AM PST How can I extract all inherited/implemented types names list Let's say that I have this hierarchy: public interface ISomething : ISomethingElse { } public class Other<T> : SomethingOther<T>, Other2 { } public class Test<T> : Other<T>, ISomething { } and now I do have ClassDeclarationSyntax for Test How can I then extract whole hierarchy? var msWorkspace = MSBuildWorkspace.Create(); var solution = await msWorkspace.OpenSolutionAsync(pathToSln); foreach (var project in solution.Projects) { foreach (var document in project.Documents) { var semanticModel = document.GetSemanticModelAsync().Result; } } (...) var root = semanticModel.SyntaxTree.GetRoot(); // and then recurisve walk if (current is ClassDeclarationSyntax classDec) { if (classDec.BaseList != null) { if (classDec.BaseList.Types.Any(x => x.ToString().Contains("_SpecificInterface"))) { var inherited = ExtractInheritedTypes(classDec, semanticModel); } } } (...) // Here are some my messy attempts to extract it static object ExtractInheritedTypes(ClassDeclarationSyntax classDec, SemanticModel sm) { var symbols = new List<ISymbol>(); foreach (var entry in classDec.BaseList.Types) { var q = sm.Compilation.GetTypeByMetadataName(entry.Type.ToString()); var s = semanticModel.GetDeclaredSymbol(entry.Type); symbols.Add(s); } return 0; } but I only managed to find "first level" of inheritance - Other<T>, ISomething , but no "deeper" | Minage usage in powershell Posted: 27 Jan 2022 03:11 AM PST I am trying to delete files which are too long filenames in Windows 10 but this powershell scripts delete all files even some files's modified date is newer than minage date. Could you please help me to solve that problem? $directory="C:\Users\test\Downloads\aaa" mkdir empty_dir robocopy empty_dir $directory /MINAGE:20210101 /mir rmdir empty_dir rmdir $directory | Non-literal types and constant expressions Posted: 27 Jan 2022 03:11 AM PST struct A { ~A() {} consteval A() {} consteval auto f() {} }; int main() { A{}; //A{}.f(); //1 } https://godbolt.org/z/4KPY5P7o7 This program is accepted by ICC, GCC and Clang, but rejected by MSVC which complains that the destructor is not constexpr in the immediate function invocation. Adding the line marked //1 results in all four compilers rejecting the code. Question: In either case, are the compilers correct, and if so why? Note that the interesting part here is that A is non-literal due to the non-constexpr non-trivial destructor. Removing its declaration, all compilers accept both the variant with and without //1 . There are a few restrictions specific to non-literal types for constexpr /consteval functions and for constant expressions, but I don't think any of them should apply here. The restrictions are on return types, parameter types, types of local variable definitions, rvalue-to-lvalue conversions and modifications of objects. I think only the last one can apply here. But what exactly does modification in [expr.const]/5.16 mean and which object would be modified here? I also think MSVC's complaint is incorrect since the destruction of the object shouldn't be part of its constructor's immediate invocation. See also my earlier question inspiring this one: Consteval constructor and member function calls in constexpr functions | Map not clickable around marker in Google Map SDK for Android Posted: 27 Jan 2022 03:11 AM PST I am building some app like image below, I want to force markers not to be clickable, but there is no setClickable(false) for Marker or MarkerOptions. Currently area around marker (see attachment) is not clickable ( click is passed to marker, not map) | The JVM option jmxremote.local.only=true does not work properly Posted: 27 Jan 2022 03:11 AM PST I wrote a batch Java 7 application that should be controlled by a JMX client. The JMX service is up and running, and I can connect to it using jConsole from my machine. I set the option -Dcom.sun.management.jmxremote.local.only=true to avoid any incoming connection except from 127.0.0.1. But... when I tried to connect from another computer, my connection wasn't filtered out, and I was able to access to JMX remotely. Here it is java invocation: java -Dcom.sun.management.jmxremote ^ -Dcom.sun.management.jmxremote.port=7000 ^ -Dcom.sun.management.jmxremote.local.only=true ^ -Dcom.sun.management.jmxremote.authenticate=false ^ -Dcom.sun.management.jmxremote.ssl=false ^ -cp lib/*;hns-consumer.jar it.andrearota.com.Main %1 Looks like that the option haven't been considered. Any help? | | OSCHINA 社区最新专区文章 Posted: 27 Jan 2022 03:06 AM PST B站社区中心的前端采用了几乎失传的实现方式…… Posted: 27 Jan 2022 01:16 AM PST 围观地址:https://www.bilibili.com/blackboard/activity-5zJxM3spoS.html 估计是为了反爬虫? | |
20% OFF Inside!🤯 ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏...
-
ExecutiveTower BuzzFeed - wtf Techdirt Daily Newsletter for Sunday, 2 January, 2022 BuzzFeed - Ani...
-
20% OFF Inside!🤯 ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏...
-
New York Jets quarterback Aaron Rodgers suffered a torn Achilles tendon in Monday's 22-16 overtime win vs. the Buffalo Bills. If you a...
|
No comments:
Post a Comment