Solaris 11 change IP in zone - ip

I've changed the IP on the global zone. Now I want to change the non-global zones.
I login with zlogin and use
ipadm delete-addr net0/?
There is a ? behind net0/
So I can't delete and set new.
Is there another way to change the IP of this zone?

From the global zone, you might check the output of:
$ dladm | grep <zone-name>
$ dladm show-linkprop <zone-name>/<iface>
zonename/aggr0 allowed-ips rw 10.2.42.142 10.2.42.142 -- --
Then, you should be able to change it using:
$ dladm set-linkprop -p allowed-ips=10.x.y.z zonename/aggr0
This might do the trick, I know if you have the link-protection to allow only listed IP address, this will update the list without the need for a reboot.
NOTE: I don't have a test zone available to actually verify this, but I know I already did this once in the past and it actually worked...

Related

Using KQL to search on subnets

I want to search something for IP's coming from a specific set of subnets. Some query languages are smart enough to know a /24 is a subnet, but KQL is not. Is there an alternative to this? This is not what I'll be searching on, but for the sake of example let's say you want to search on SignIn logs but only from machines in the 192.168.1.0/24
Please check:
https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/ipv4-is-matchfunction
datatable (ip:string)
[
'192.168.1.64', // match
'192.168.2.11', // no match
]
| where ipv4_is_match(ip, '192.168.1.0/24')

Reboot and stop image booting with C-Kermit

I'm currently using c-kermit with a serial connector to my ARM-Board. So, if I type reboot into the c-kermit connected terminal, the Board reboots. Okay, then I type Space, while it boots, to get into U-Boot. This works fine.
But I want to write a script for it. So, if I execute this script I'm already in the U-boot terminal.
My currently used .kermrc is the following:
set line /dev/ttyUSB3
set speed 115200
set carrier-watch off
set handshake none
set flow-control none
robust
set file type bin
set file name lit
set rec pack 1000
set send pack 1000
set window 5
connect
input "reboot"
input " "
input " "
output instead of input also doesn't work.
Please check, if the below link helps you some how.
http://blog.mezeske.com/?p=483

Test if Wireless Adapter is Working Before Resetting

Is there a simple way to prove if a network adapter is working? Perhaps some IP like localhost (127.0.0.1) which is always available regardless of which network I'm connected to; only one that only shows if my wireless network adapter's working? Or perhaps there's some simple diagnostic check to confirm this?
I've tagged this question as PowerShell as that's my preferred language; but I can figure out ways to integrate with any other solutions which may be suggested.
Tried so far
I thought of checking the adapter's properties and found there is a status and an IP; I figured that if there were an assigned IP or a connected status that would prove that all's working; sadly those properties are blank and unknown, so I can't use them.
$adapter = Get-WmiObject -Class Win32_NetworkAdapter | Where-Object {$_.Name -like '*Wireless*'}
$adapter.Status #returns 2; i.e. unknown
$adapter.NetworkAddresses #is blank
Background
I have an issue where I hibernate my laptop whilst docked then bring it back online no longer docked it loses its wireless connection and requires that the adapter be restarted. The same issue is mentioned in this post: Command/Powershell script to reset a network adapter
I'm hoping to use the above code to automatically resolve the issue by scheduling a task to run when my computer comes out of suspension (e.g. https://superuser.com/a/149924/156700).
Sometimes I'll be on my home network, where the only device to ping is my router, sometimes I'll be on my office network where there's a range of machines I could ping, and sometimes I'll be elsewhere... so determining a good target candidate to test whether my network adapter needs a restart by pinging some external device is more complex than ideal.
I want to run a test before resetting so that I only reset when required. It will also be useful to check once a reset has completed should I wish to queue other tasks which require network presence to complete.
It seems the WMI class Win32_NetworkAdapter has an Availability property.
https://msdn.microsoft.com/en-us/library/aa394216(v=vs.85).aspx
There are a range of values which could represent "working"; for now I've gone with only status 3; i.e. where everything's working 100% as expected / there's no concerns about potential degredation. That may be something worth amending depending on scenario.
function Test-NetworkAdapter {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]$AdapterNameMask
,
[Parameter(Mandatory = $false)]
[int[]]$HealthyStatusses = #(3) #100% working on full power; for list of other possible values, see https://msdn.microsoft.com/en-us/library/aa387884(v=vs.85).aspx
)
process {
Get-WmiObject -Class Win32_NetworkAdapter `
| Where-Object {$_.Name -like $AdapterNameMask} `
| Select-Object #{Name='Working';Expression={$healthyStatusses -contains $_.Availability}}
}
}
function Reset-NetworkAdapter {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]$AdapterNameMask
)
process {
Get-WmiObject -Class Win32_NetworkAdapter `
| Where-Object {$_.Name -like $AdapterNameMask} `
| %{ #in case multiple matches, loop through all
$_.Disable()
$_.Enable()
}
}
}
[string]$wirelessAdapterMask = '*Wireless*'
#I could probably improve this to cope better should there be multiple matches / only resetting those with issues... but for now this meets my requirement
if (-not (Test-NetworkAdapter $wirelessAdapterMask)) {
Reset-NetworkAdapter $wirelessAdapterMask
}

Example use case of tmux's "refresh-client"?

From the man page (http://manpages.ubuntu.com/manpages/precise/en/man1/tmux.1.html):
refresh-client [-S] [-t target-client]
(alias: refresh)
Refresh the current client if bound to a key, or a single client
if one is given with -t. If -S is specified, only update the
client's status bar.
What does it mean for a client to be bound to a key? I'm trying to think of when I may actually use this.
This is by default bound to "r" in tmux, and I'm thinking of overriding it. Could someone explain an example use case for wanting to refresh the client? Thanks.
tmux only updates the screen when there is some new content to display. If you put something like date into your status line, the date will only update when the content of the pane changes, when you change between panes, or when run refresh-client. So in that case, you could use Ctrl-b r to refresh the screen.
Alternatively, you can also set set status-interval 1 to redraw every second, but that will cause CPU usage and drain your battery.
If you don't have anything dynamic in your status line, you can safely remap the key. And if you ever need to execute refresh-client, you can still run it with tmux refresh-client.

Asterisk: Record application is generating empty files

User making the call is asked to dial an extension. This is done by 1#playing a prompt with Background and then 2#wait_for_digit. Based on the extension that has been dialed, the destination number is determined and the call is forwarded to that number.
If the called person doesn't not answer, then Playback is used to play a prompt that asks the user to record the voice message; recording the voice message is done with the Record application.
This Record application is always generating empty wav files, size 44 bytes. If I remove the 1#playing a prompt with Background the Record application is generating proper files. If the Background is included, all recordings are empty.
I am using Perl Asterisk::AGI module.
$agi->exec('Answer');
....
.....
$agi->exec('Background', 'en/extra/please-enter-the-extension,n'); # this is the troubling part
my $my_extension = $agi->wait_for_digit(5000);
....
.....
$agi->exec('Playback', 'en/extra/the-party-you-are-calling&en/extra/is-curntly-busy,noanswer');
$agi->exec('Playback', 'en/vm-intro,noanswer');
my $file = 'xyz.wav';
$agi->exec('Record', "$file,0,10,k");
...
...
What should I do to make it work as I want it to?
Thank you.
UPDATE 1:
The same script is working without glitches now. Not sure if something unrelated to the script has changed.
Most likly you have check your codecs. IF you use g729 or g723 and no transcoder,it just can't write in wav format.

Resources