Can I reuse the DNS name of an old Azure classic VM?

I currently have a “classic” virtual machine running on Azure at foobar.cloudapp.net.

I’m intending to replace this VM with a newly created VM on azure.
When I try to configure the new VM’s DNS name, I see this dialog (screenshot), implying that DNS entries for all newly created VM’s will end in .cloudapp.azure.com.

Is there any way for me to reuse the old VM’s DNS name?

nonce – hello please let me know whats wrong with this script for find Reuse R value

hello friends here is the code to find reuse R values of bitcoin transaction but unfortunately it is not scanning more than 51 transaction secondly it can only use one address at a time and i want to use text file to check multiple addresses as well as i want to save the output in a text file please help me to sort out 

import json

import urllib2

import time

import sys

#for some reason blockchain.info api-chain is 59711 blocks short..

blockstart = 170399

blockstart += 59711

blockcount = urllib2.urlopen(“https://blockchain.info/de/q/getblockcount”).read()

print “WELCOME TO R-scan v0.1.2!”

print “ADDRESS-R-SCAN: “

addr = raw_input(“type address: “)

urladdr = “https://blockchain.info/de/rawaddr/” + str(addr)

#control api-url

print urladdr

addrdata = json.load(urllib2.urlopen(urladdr))

print “Data for pubkey: ” + str(addr)

print “number of txs: ” + str(addrdata(‘n_tx’))

#tx-details:

y = -0

inputs = ()

while y < addrdata(‘n_tx’):

print “#################################################################################”

print “TX nr :” + str(y+1)

print “hash: ” + str(addrdata(‘txs’)(y)(‘hash’))

print “number of inputs: ” + str(addrdata(‘txs’)(y)(‘vin_sz’))

#only if

#if addrdata(‘txs’)(y)(‘vin_sz’) > 1:

zy = 0

while zy < addrdata(‘txs’)(y)(‘vin_sz’):

  print "Input-ScriptNR " + str(zy+1) + " :" + str(addrdata('txs')(y)('inputs')(zy)('script'))
  inputs.append(addrdata('txs')(y)('inputs')(zy)('script'))
  zy += 1

y += 1

print “compare: “

xi = 0

zi = 1

lenx = len(inputs)

alert = 0

#compare the sig values in each input script

while xi < lenx-1:

x = 0

while x < lenx-zi:

  if inputs(xi)(10:74) == inputs(x+zi)(10:74):
      print "In Input NR: " + str(xi) + "(global increment) " + str(inputs(xi))
      print('a')
                   print "Resued R-Value: "
      print inputs(x+zi)(10:74)
                   alert += 1
  x += 1

zi += 1

xi += 1

#check duplicates

#alert when everything ok

if alert < 1:

print “Good pubKey. No problems.”

sys.exit()

Reuse air gapped Raspi used for seed generation?

Would it be wise for an air gapped RasPi used for seed generation be used again online with a new micro SD card? Am i missing anything?

encryption – Whether TLS session resumption reuse the symmetric keys?

I am learning TLS Session Resumption.

What I got is session resumption can reduce 1 RTT for TLS 1.2 by reusing MasterSecret. Both the client and server needn’t to run key exchange algorithm.

My questions are:

  1. Whether session resumption reuses symmetric encryption keys (to encrypt TLS records).
  2. What factors affect whether to reuse symmetric encryption keys?

I searched around Google, but cannot find a authoritative answer. Here is what I got:

  1. Do not reuse encryption keys. Refer to SSL session key usage when browser opens multiple sockets to same server.
  2. Reuse encryption keys. Refer to https://wiki.openssl.org/index.php/SSL_and_TLS_Protocols#Session_Resumption

Any ideas are welcome.

coding style – Variable name re-use: can it be a good thing?

Famously, from how to write unmaintainable code, it is said unmaintainable code reuses variable names:

Wherever the rules of the language permit, give classes, constructors, methods, member variables, parameters and local variables the same names. For extra points, reuse local variable names inside {} blocks. The goal is to force the maintenance programmer to carefully examine the scope of every instance. In particular, in Java, make ordinary methods masquerade as constructors.

I understand how this can be abused, but I’ve seen very readable code make good use of this technique. Generally that code has small method bodies, and the name is consistent, in that it always represents the same effective object (although it may be normalized or transformed in each step, or maybe a default value that was overridden). Often there is also only one object that matters in the method (so the code follows single-responsibility principles well).

However, I can’t remember any concrete examples of this from well-regarded open source, although I have seen them. Anyone have some examples that demonstrate how to use this technique well, and how it may be clearer than alternatives? Pull requests that refactor in this direction with notes as to why would be especially good answers.

taxonomy terms – Reuse fields programmatically

Conceptually and for performance purposes it is advisable to reuse existing fields in Drupal. This is very easy to do manually, but my question is, how can I do this programmatically?
I have the following code:

$all_bundle_fields = Drupal::service('entity_field.manager')->getFieldDefinitions('taxonomy_term', $vid);

if (!isset($all_bundle_fields('field_image'))) {
  FieldStorageConfig::create(array(      
    'field_name' => 'field_image',
    'entity_type' => 'taxonomy_term',
    'type' => 'entity_reference',
    'settings' => (
      'target_type' => 'media',
    ), 
    'cardinality' => 1      
  ))->save();

  FieldConfig::create(array(      
    'field_name' => 'field_image',
    'entity_type' => 'taxonomy_term',
    'bundle' => $vid,
    'label' => 'Logo',
    'description' => 'Logo to represent the term.',
    'required' => FALSE,
  ))->save();
}

In this example, I extract all the fields from the vocabulary and only create the field if and only if it does not exist previously in this vocabulary. The above code works.

What does not work here is if that field has already been created for another entity or vocabulary. This is what I would like to find out in order to make a complete reuse of the fields.

Thanks in advance.

How to reuse code in Github without passing other code as mine?

I’m doing my first real project on Github (in Python) and I’m using functions from two other repos (which I’ll call foo and bar) as well as rewriting some of their modules.

I have two options.

  • Option 1: separate my code and theirs, rewrite what I need and import the rest.

Structure on my computer:

.
├── foo
├── bar
└── mypackage

Structure on Github (When someone clones my repo then they need to clone foo and bar as well)

.
└── mypackage
  • Option 2: mix my code and theirs, such that it may be indistiguishable that I used another code.

Structure on my computer and on Github:

.
└── mypackage

I feel like option 2 is simpler since my code is standalone, but I also feel like it does not make clear what I reused and what I coded myself.

Of course in both options I would mention foo and bar in my README.

So my question is: which option should I choose?

Thanks!

Dependency Inversion principle and high-level module reuse

When implementing DIP, the higher layer (which exposes the interface that the lower layer will implement), can therefore write reusable code that handles any implementation of this exposed interface.

At best, Wikipedia could’ve better said “encourages code reuse inside the higher/policy layers”, but that is what it already intends to convey and the two variants are synonymous enough.

In the current phrasing on Wikipedia, I suspect you’ve misinterpreted it to imply that the higher layer gets reused by multiple consumers. It doesn’t.

But DIP does enable the higher layer to write its own code more reusably, and that’s what Wikipedia means.


As a very basic example, if your domain (higher layer) exposes a IFooRepository that will be implemented by one or more database projects (lower layer projects), then your domain can write IFooRepository-handling logic once, no matter how many implementations of IFooRepository exist, in no matter how many lower layer projects.

Therefore, the domain logic for IFooRepository is more reusable than it would’ve been without DIP.

Because without DIP, each lower layer project would expose its own interface to the domain, and the domain would’ve had to handle these different interfaces individually. That’s less reusable.

hard drive – Reuse a SSD MZ-JPV1280/0A4 as external ssd installing Ubuntu on it

I have a 128 Gb SSD Samsung Model MZ-JPV1280/0A4 from my MacBook Pro retina 2015 and I would like to reuse it in my new pc (ASUS Vivobook Pro, with Core i7 7th Gen, Nvidia GTX 1050, 16gb ram..) where i have done a partition of 50Gb for popOs (Ubuntu). I would like to expolit the power of the SSD as external disk. Is it possibile? How?
Thank you for your time!

https – Should I have a separate SSL certificate for CDN or I can re-use existing website’s certificate?

I’m about to add CDN to my website, doing the research. My plans are to use CDN for static content only (CSS, JS, images), so the initial HTML pages are always dynamic, and some other critical downloads are also non-cacheable. I don’t know if this changes anything in how I connect CDN or not, from what I’ve read, I just change the nameservers to point to CDN and don’t need to alter any links from my side, and CDN inspects headers to see what should be cached and what should not.

My question

Do I need to buy a separate SSL certificate especially for CDN and have it installed at CDN or I can use the same DV certificate I bought for my website, e.g., from Sectigo? In other words, should I own 2 certificates in case having CDN, or can own just one (DV) and use it both on my server and on CDN? And let us suppose that the answer is “I need 2 certificates”. Does it matter what kind of certificate is then used on the CDN side (self-signed, DV, OV, EV) ?