Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Not strictly a programming question, but I was programming at the time and couldn't find an answer, so I thought, "Hey, I'll give StackOverflow a try!"
So I'm connected to my Windows XP work PC over a Remote Desktop connection through VPN. In a command window (on the remote PC), I foolishly type ipconfig /release. A split second before I come to my senses, I hit Enter. D'oh!
So what now? Am I hosed until I get to the office Monday morning? Any way to remotely make my office PC get itself a new IP address?
If it makes you feel any better, most of us have done something similar. I can't offer a suggestion that doesn't involve human intervention, but I can offer two ways to prevent a "next time" for you:
Look into a remote power controller. Cheap (inexpensive, hobbyist-grade) options are available through www.x10.com; other vendors (Pulizzi, DataProbe, etc.) provide more reliable solutions for a higher price. You may even be able to find a UPS that allows you to control it via a serial port.
Plug your PC into the power controller, and find a second PC to control it. Now you can reboot your PC remotely, no matter how badly you de-configure it.
Anticipate and compensate. It's reasonable to expect that you may need to release/renew the IP address again, so write a utility that will check for the loss of IP address and reboot if that occurs. For example, ping your default gateway and reboot if the ping fails consistently. Just be sure to anticipate the consequences of an unexpected reboot!
Try giving a call to the office and get someone(if any) to restart your computer or ipconfig /renew
What you need to do, is find some way to cut the power to your PC. Many PCs are configured by default to reboot if there is a power failure. So, just hack into your power grid, and shut off power to the entire building. Once your computer reboots, along with all the other equipment, your computer should have it's IP back.
(This probably won't work)
I think if you get your network connection severed, it'll reset (like, if I run ipconfig /release, then shut off my router and restart it, I get a new IP).
It'd be well winging it, but if I was desperate I'd hook up to my DHCP server and reboot it.. I predict the end result would be me still not being able to connect, and the admins giving me a good whipping.
Log into the managed switch the PC is connected to, shutdown the port, wait a few seconds, and then bring it back up. If you don't have a managed switch or no access to it, wait until Monday.
Related
I'm working with server automation tools on some Dell C2100 and C1100 servers. What I intend to do is connecting via Serial Over Lan using ipmi.
A few weeks ago, I was able to connect to one of my servers using ipmi-console (from freeipmi), like this:
ipmi-console -h IPADDRESS -u USER -P
This started up a SOL connection, and this way I was able to automate some interactions with the server's BIOS settings and other stuff.
However, a few days later, the same script didn't work anymore. It just says "[SOL established]", and that's it: the SOL connection never shows any feedback, and it stays idle until I close the connection.
My question is: what could possibly have changed that the SOL connection is not working anymore.
I obviously checked for anything related to SOL and IPMI, both in BIOS settings and using BMC web GUI. But everything looks normal, and I didn't recall to have changed anything there between the time the connections worked and then they stopped working. IDK what else to check, and it just fails w/o errors anywhere.
Perhaps this is a common thing with IPMI and/or SOL, but I frankly don't understand it. So, any pointer would be nice.
Thanks in advance.
FreeIPMI maintainer here. When no data is being output, it is typically a configuration problem. Assuming none of that changed, one idea.
On some motherboards, I've seen the BMC internally "lose its connection" to the serial chip, thus it doesn't get any serial data and thus doesn't have anything to send out. Unfortunately a hard power reset is often needed to solve this (b/c the BMC always is "on" via standby power, it must be a hard reset to reset it). Hard resetting the BMC directly might work as well, you can do this in FreeIPMI via bmc-device --cold-reset.
Finally, I've found what was going on.
It happened that somehow a value DID change on the BIOS settings, most likely my own mistake: remote connection ability was disabled. That means, it seems, that SOL works, but it doesn't redirect anything. Given that I was able to connect through SOL, it seemed obvious that remote connection ability was enabled.
Once enabled that BIOS setting, everything was back to normal.
BTW: freeipmi is awesome. Thanks for maintaining it Albert.
The title pretty much says it all. So, I have a no-break connected to my PC, because we have a lot of blackouts here where I live. The problem is: if I'm not at home, who will shutdown my PC correctly if there is a blackout? So, I realized that my modem is not connected to the no-break; this means that, in the case of a black-out, my modem will turn off, thus, no internet will reach my computer, so this is kind of a way to tell my PC when lights are out.
Sure, this might not be always the case (sometimes the internet just goes off for reasons other than power), but I will accept this risk.
So, what I am looking for is a code that, once I execute it (what I'll do when I'm leaving home), checks if there is internet conection. If yes, than do nothing and keep checking. If not, than shutdown the computer.
Is there any way to query the system's date/time via USB without installing anything on the host computer (maybe just drivers)?
Background of the original problem
To avoid the XY problem, let me explain a bit what I'm trying to do.
To be able to calculate a TOTP token for 2FA (e.g. like Google Authenticator app does) you need a real-time clock to get the date and time.
There's this USB device called SC4-HSM that I would like to use to calculate the tokens, however it doesn't have a clock and according to the designer, adding one would be too expensive (needs a battery, etc).
Possible solution to the original problem
This device is going to be used with a computer which already has an RTC of course. Thus I had the idea of querying the system for a date/time which would solve the issue.
(Note: I know that a USB device can be connected to all sorts of hosts and not all hosts will have an RTC, but since this only needs to work with a computer, I thought this shouldn't be an issue)
My first thought was that there might be some USB device class that had date/time needs, so I could register the device as that type and then I would be able to query the values.
After going through the device class codes list (Internet Archive) nothing jumped at me as needing date/time. The closest ones I could think of were:
Content Security (PDF)
Personal Healthcare
Smart Card Class (PDF)
I skimmed the device class documents in the USB Implementers Forum but there's nothing in there even remotely related to date or time.
Current problem
Since the USB specs seemed like a dead-end I thought that maybe there was a way to write a very simple USB driver that can be auto-loaded when the device is plugged in to a computer and then we can use the driver to return the date/time when the device asks for it (unless I'm misunderstanding something).
I am now looking through USB development docs like Michael Opdenacker's Linux USB drivers course, I tried the Linux USB Project which seems dead. Skimmed through Driver Development for Windows NT just to get an idea, however I am still not able to figure out if this is possible or not, and how hard it would be.
I'm a complete beginner at this and maybe this is something out of my skill level, but I would like to figure out if will I need weird hacks and workarounds or is there a much more straightforward way to do this?
There seems to be little information about it or I'm just searching the wrong places.
Any ideas/or pointers on either solving the original problem or the current one?
system time is not necessarily the general time i.e. the 'atomic' time you get from a NTP server
the most obvious solution is to use autorun, this is also possible on linux but normally autorun is blocked so the user explicitely has to activate it
https://askubuntu.com/questions/642511/how-to-autorun-files-and-scripts-in-ubuntu-when-inserting-a-usb-stick-like-autor
the linux command to get the time is date or hwclock or if the computer is connected to the net it may be possible to contact a NTP server (if the firewall does not block this)
then your autorun program has to send the data to the SC4-HSM. i do not know what USB classes the SC4-HSM implements if it implements CDC ACM (virtual COM port) this is easy:
Unable to sync computer time to Arduino via USB
(something like echo "T$(($(date +%s)+60*60*$TZ_adjust))" >/dev/tty.usbmodemfa131)
maybe it is possible to access system time over the USB drivers, i do not know this right now
I am trying read traffic from a couple of test mobile devices, iphones, androids etc. I've done this for over a year using primarily Fiddler but also Charles. I did it up until yesterday without any issue. But today the devices do not appear to be connecting to my computer. I have confirmed that everything is configured right eg. device is set to use my computer as a proxy after I put in my computers IP address that I got by doing a simple ipconfig, sorry if this all sounds redundant but just letting you know my steps, better to have more information than less. I also turned off my firewall no change.
I thought perhaps something was done to our network, but I installed Fiddler on a coworkers computer and was able to proxy into that computer without any issue. Confirmed all drivers are up to date and really there was no change between yesterday and today except a deep scan with Malwarebites. Frankly sort of at a loss for what it might be, I have reinstalled Fiddler on my computer (the primary one I use, didn't reinstall Charles cause I don't want to deal with license issue right now) but at same time what are the chances that both stopped working at same time.
There's a high likelihood that your PC's firewall is blocking the inbound connection. You should check your firewall configuration to see if it's configured to allow inbound connections to Fiddler.
On your Fiddler-running PC, ensure Tools > Fiddler Options > Connections > Allow Remote Computers to connect is checked (if not, check it and restart).
From your co-worker's PC, try visiting http://<FiddlerPCName>:8888/ in the browser. Does the traffic appear in Fiddler?
I would like to send a message, or something can be an advise from a pc to an another pc (only one, or at the most 2), the latter is powered off.
The pc which should send the message is a windows server 2003 os, instead the pc which should receive the message is a windows xp os.
The two machines are in the same domain and they work together through an ingres database.
The message will be sent at night, because there is an ingres database back up procedure that runs at night when my pc will be powered off, but when in the morning i will be at work I would like to read this message as a net send message, or something like
Unfortunately the net send command is disabled in our network, so I can't use it, but i'm looking a way for sending this message.
Have you any suggestion? thank you
Use age-old simple file based messaging.
Store a message in a specific file in the server and write a simple application which runs on startup on your machine to read it and display it.
And this is apart from rerun's great suggestion :)
There is breaking new technology available called email.
Is the machine powered off or in standby?
If if is in standby, then I will defer to someone who may have a better idea of how to get wake the machine to wake up programatically(sp?).
If it is powered off then read on...
If you have access to the machines bios settings, then I would suggest scheduling a power on event in the range of the time before the backup normally completes.
Then it is a matter of receiving the message and optionally shutting back down afterward?
If you are unable to change the bios settings, then does the machine "power on after power loss?" If so, get a programmable timer from the nearest retail store and power off before leaving at night and have the timer set to power on before the time the backup could reasonably be completed.
This is not really a software solution per se, but your problem does seem to be mostly hardware related (with the power off requirement and all...)