EzDevInfo.com

radius interview questions

Top radius frequently asked interview questions

How to calculate radius of ring in MATLAB?

I have a stack of cortical bone images, high resolution and binarized. How do I go about calculating the mean inner and outer radii for each image? Here is an example of the kind of images I need to process:


Source: (StackOverflow)

Scapy fails to capture RADIUS responses

I am trying to use Scapy to send a simple RADIUS access-request to my RADIUS server, but Scapy fails to catch the response. I have used tcpdump and a Scapy sniff to verify that the access-accept is in fact received by the client.

Here is my setup:

The Packet: (AVP is a custom built layer)

<IP  frag=0 proto=udp dst=10.200.202.19 |<UDP  sport=10999 dport=radius |<Radius  code=Access-Request authenticator='W\xe8\xe1\x81FD\xdalR,\x9e8?\x8e\xda&' |<AVP  type=User-Name data='testing' |<AVP  type=User-Password data=',\xea\x84p\x8b\x8e\x8bo\x1c\xa5P\x9cR\xea\xb5M' |<AVP  type=NAS-IP-Address data='127.0.1.1' |<AVP  type=NAS-Port data='0' |>>>>>>> 

2 terminals on the client side:

terminal 1

usesr:~$ sudo tcpdump -i eth0 'udp and port 1812'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
****SEND PACKET FROM OTHER TERMINAL****
18:05:47.567307 IP radclient.10999 > radserver.radius: RADIUS, Access Request (1), id: 0x00 length: 61
18:05:47.568041 IP radserver.radius > radclient.10999: RADIUS, Access Accept (2), id: 0x00 length: 20

terminal 2

>>> sr(pkt, iface='eth0', filter='udp and port 1812', timeout=5)
Begin emission:

.Finished to send 1 packets.
.
Received 2 packets, got 0 answers, remaining 1 packets
(<Results: TCP:0 UDP:0 ICMP:0 Other:0>, <Unanswered: TCP:0 UDP:1 ICMP:0 Other:0>)

I dug around the Scapy source code a bit and noticed that when looking for a response, we do two main things, compare the hashret() value of the received packet to the hashret() value of the sent packet, and we verify that recPkt.answeres(sentPkt) is true. To satisfy these checks, I did the following:

>>> a = sniff(iface='eth0', filter='udp and port 1812')
♥>>> a
<Sniffed: TCP:1 UDP:2 ICMP:0 Other:0>
>>> a.summary()
Ether / IP / TCP 10.200.202.191:ssh > 10.200.201.242:51044 PA / Raw
Ether / IP / UDP 10.200.202.191:10999 > 10.200.202.19:radius / Raw
Ether / IP / UDP 10.200.202.19:radius > 10.200.202.191:10999 / Raw / Padding
>>> a[1].hashret()
'\x00\x08\x00\x00\x00\xac\x11'
>>> a[2].hashret()
'\x00\x08\x00\x00\x00\xac\x11'
>>> a[2].answers(a[1])
1

After this, I started running a simple test in eclipse and trying to step through the program, from what I can tell, the sr() seems to miss the response altogether and subsequently never does any processing on it.


Source: (StackOverflow)

Advertisements

Zip code distance R

I'm using the Zip Code package in R, and I'd like to make a list of all zip codes that are within a 10, 20, or X mile radius from each zip code. From there I will roll up zip code data to a 10, 20, or X mile total. I'm currently joining every single zip code, with each zip code (so the number of rows squares). Then calculating the distance between each zip code. And then eliminating the distances where greater than 10,20, X miles. Is there a better way to do this in R so I do not have to calculate all possibilities? I'm brand new to R. Thanks!

Code is here:
#Bringing in Zipcode database. 
library(zipcode)
data(zipcode)

#Limiting to certain states that I want to include,
SEZips <- zipcode[zipcode$state %in% c("GA","AL", "SC", "NC"),]

#Duplicating the data set to join it together
SEZips2 <- SEZips

#To code in SQL
library(sqldf)

#Creating a common match so I can join all rows from both tables together
SEZips$Match <- 1
SEZips2$Match <- 1

#attaches every zip code to each zip
ZipList <- sqldf("
                 SELECT
                 A.zip as zip1,
                 A.longitude as lon1,
                 A.latitude as lat1,
                 B.zip as zip2,
                 B.longitude as lon2,
                 B.latitude as lat2
                 From SEZips A
                 Left Join SEZips2 B
                 on A.Match = B.Match
                 ")


#to get the distance calculation, use package geosphere, 
library(geosphere)

#radius of Earth in miles, adjust for km, etc.
r = 3959
#Creating Table of the coordinates. Makes it easy to calc distance
Points1 <- cbind(ZipList$lon1,ZipList$lat1)
Points2 <- cbind(ZipList$lon2,ZipList$lat2)
distance <- distHaversine(Points1,Points2,r)

#Adding distance back on to the original ZipList
ZipList$Distance <- distance

#To limit to a certain radius.E.g. 15 for 15 miles.
z = 15
#Eliminating matches > z 
ZipList2 <- ZipList[ZipList$Distance <= z,]

#Adding data to roll up, e.g. population
ZipPayroll <- read.csv("filepath/ZipPayroll.csv")

#Changin Zip to 5 character from integer. A little bit of pain
#Essentailly code says (add 5 0's, and then grab the right 5 characters)
ZipPayroll$Zip2 <- substr(paste("00000",ZipPayroll$zip,sep=""),nchar(paste("00000",ZipPayroll$zip,sep=""))-4,nchar(paste("00000",ZipPayroll$zip,sep="")))

#Joining Payroll info to SEZips dataframe
SEZips <- sqldf("
                SELECT
                A.*,
                B.Payroll, 
                B.Employees,
                B.Establishments
                From SEZips A
                Left Join ZipPayroll B
                on A.zip = B.Zip2
                ")

#Rolling up to 15 mile level
SEZips15 <- sqldf("
                  SELECT
                  A.zip1 as Zip, 
                  Sum(B.Payroll) as PayrollArea,
                  Sum(B.Employees) as EmployeesArea,
                  Sum(B.Establishments) as EstablishmentsArea
                  From ZipList2 A
                  Left Join SEZips B
                  on A.zip2 = B.zip
                  Group By A.zip1
                  ")

#Include the oringinal Zip data 
SEZips15 <- sqldf("
                  SELECT
                  A.*,
                  B.Payroll,
                  B.Employees,
                  B.Establishments as EstablishmentsArea
                  From SEZips15 A
                  Left Join SEZips B
                  on A.zip = B.zip
                  ")

#Calculate Average Pay for Zip and Area
SEZips15$AvgPayArea <- SEZips15$PayrollArea / SEZips15$EmployeesArea
SEZips15$AvgPay <- SEZips15$Payroll / SEZips15$Employees

Source: (StackOverflow)

Sub Query Problems

Im having issues getting my head around how i go about coding the following. I have one table with a list of lat/longitudes and another table with a list of place names with latitudes and longitudes. What i need to do is this : 1) Loop through each item in table 1, grab the lat and long, do a radius search on table 2 and grab the place name, update table 1 with the new place name. This code gets me the place name i require :

$sql="SELECT *, (3959 * acos(cos(radians('".$lat."')) * cos(radians(lat)) * cos( radians(lon) - radians('".$lng."')) + sin(radians('".$lat."')) * 
sin(radians(lat)))) 
AS distance 
FROM cats HAVING distance < 5 ORDER BY distance LIMIT 1";

I need help figuring out how i join the 2 queries together, or the best way for me to loop through lat/longs from table 1. I tried doing this with a php loop but i dont think thats the best way and i couldn't get it to work

Thanks for any help or suggestions!


Source: (StackOverflow)

Check if a GPS location is within a certain radius of another GPS location in android

I'm developing an Android app which takes the user's current location and shows other users' gps locations on a map which falls with a certain radius, say 20 kilometers.

For example, if I am the user, I want to see other users' locations plotted on a map who are within a radius of 20 kilometers from my location.

I am able to save my location, other users' locations and plot them on map also. I am not able to figure out if those users fall in 20 kilometers radius from my location or not.

I use Google Maps Android API v2 to plot locations on map and Parse for saving the GPS locations (latitude and longitude coordinates)

I Googled for solutions but in vain. Could anyone please provide a hint or reference or sample code on how to check if a GPS location is within a certain radius of another GPS location or not.

Any help will be appreciated.


Source: (StackOverflow)

Implementing 802.1x Authenticator in software?

Our device is a router running Linux 2.6.19 and we require 802.1x authentication for clients connecting to the built-in switch on the LAN side.

The switch does not provide any support for 802.1x. I have installed hostapd on the router which uses a RADIUS back-end, but this appears to be useless without the port authentication entity.

Is it possible to implement the Port Authentication Entity or similar feature in software?


Source: (StackOverflow)

RADIUS with MS-CHAPv2 Explaination

Can't find any flowcharts on how communication works between peers. I know how it works in Radius with PAP enabled, but it appears that with MS-Chapv2 there's a whole lot of work to be developed.

I'm trying to develop a RADIUS server to receive and authenticate user requests. Please help me in the form of Information not code.


Source: (StackOverflow)

Is there an algorithm to generate a graph outline?

I've searched the Internet and maybe I'm missing some correct keywords but I managed to find nothing like this. I only found the poly-lines (or just the lines) which are not exactly the graphs. I would like to generate a graph outline (of radius r) as seen in the picture. Is there something already available? I would like to avoid reinventing the wheel so to speak.

enter image description here

If anyone can at hint me at something or at least at some basic principle how to do it it would be great. Otherwise I'll "invent" one on my own of course.

Optimally in C#.

Update: I need to calculate outline polygon, not just visually draw it. The green points represents the resulting polygon. Also the "inner" holes are ignored completely. Only one outline polygon should be enough.

Update 2: Better picture to show some more extreme cases. Also the edges of graph never overlap so no need to accommodate for that.

Update 3: Picture updated yet again to reflect the bevel joins.


Source: (StackOverflow)

Firefox border radius rendering issue

It seems like Firefox (32, 35, 36) adds a fine gray corner when rendering border radius: enter image description here

Here is also a very simple test: http://jsfiddle.net/imehesz/5ete1ctp/

.abox {
width:100px;
height:100px;
background-color: red;
border-left-color: rgb(0, 255, 87);
border-left-style: solid;
border-left-width: 10px;
border-right-color: rgb(0, 255, 87);
border-right-style: solid;
border-right-width: 10px;
border-bottom-color: rgb(0, 255, 87);
border-bottom-style: solid;
border-bottom-width: 10px;
border-top-color: rgb(0, 255, 87);
border-top-style: solid;
border-top-width: 10px;
border-top-left-radius:20px;
border-top-right-radius:20px;
border-bottom-left-radius:20px;
border-bottom-right-radius:20px;    

-moz-box-shadow: 0 0 0 0 rgb(127, 127, 127),0 0 0 0 rgb(127, 127, 127) inset;
-webkit-box-shadow: 0 0 0 0 rgb(255, 255, 255),0 0 0 0 rgb(127, 127, 127) inset;
box-shadow: 0 0 0 0 rgb(127, 127, 127),0 0 0 0 rgb(127, 127, 127) inset;
}

If I remove background-color OR box-shadow it works. But in my case I need those.

Is there any way to fix this? (I didn't see anybody reporting this issue on the web!?)


Source: (StackOverflow)

Radius test only success in the local machine, but can't through remote machine

I install the freeradius in Ubuntu 10 through apt-get.

after make the server running. the local test is valid:

yozloy@SNDA-192-168-21-78:/usr/bin$ echo "User-Name=testuser,Password=123456" | radclient 127.0.0.1:1812 auth testing123 -x
Sending Access-Request of id 245 to 127.0.0.1 port 1812
    User-Name = "testuser"
    Password = "0054444944"
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=245, length=20

But in the remote machine, it seems that there's no response from the radius server machine:

root@SNDA-192-168-14-131:/home/yozloy# echo "User-Name=testuser,Password=123456" | radclient 58.215.164.98:1812 auth testing123 -x
Sending Access-Request of id 36 to 58.215.164.98 port 1812
    User-Name = "testuser"
    Password = "0054444944"
Sending Access-Request of id 36 to 58.215.164.98 port 1812
    User-Name = "testuser"
    Password = "0054444944"
Sending Access-Request of id 36 to 58.215.164.98 port 1812
    User-Name = "testuser"
    Password = "0054444944"
radclient: no response from server for ID 36 socket 3

Here's my configure file:

clients.conf

client 58.215.164.98 {
        ipaddr = 58.215.164.98
        secret = testing123

        require_message_authenticator = no
}

users

testuser CLeartext-Password := "0054444944"

update the configure file(I'm not actually change anything) radiusd.conf

proxy_requests  = yes
$INCLUDE proxy.conf
$INCLUDE clients.conf
thread pool {
        start_servers = 5
        max_servers = 32
        min_spare_servers = 3
        max_spare_servers = 10
        max_requests_per_server = 0
}
modules {
        $INCLUDE ${confdir}/modules/
        $INCLUDE eap.conf
}
instantiate {
        exec
        expr
        expiration
        logintime
}
$INCLUDE policy.conf
$INCLUDE sites-enabled/

yozloy@SNDA-192-168-18-234:/etc/freeradius$ netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 192.168.18.234:22       123.5.13.20:3274        ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN     
udp        0      0 0.0.0.0:1812            0.0.0.0:*                          
udp        0      0 0.0.0.0:1813            0.0.0.0:*                          
udp        0      0 0.0.0.0:1814            0.0.0.0:*                          
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  4      [ ]         DGRAM                    2838     /dev/log
unix  2      [ ACC ]     STREAM     LISTENING     2166     @/com/ubuntu/upstart
unix  2      [ ]         DGRAM                    2272     @/org/kernel/udev/udevd
unix  3      [ ]         STREAM     CONNECTED     3351     
unix  3      [ ]         STREAM     CONNECTED     3350     
unix  2      [ ]         DGRAM                    3173     
unix  2      [ ]         DGRAM                    2893     
unix  3      [ ]         DGRAM                    2304     
unix  3      [ ]         DGRAM                    2303     
unix  3      [ ]         STREAM     CONNECTED     2256     @/com/ubuntu/upstart
unix  3      [ ]         STREAM     CONNECTED     2255  

Source: (StackOverflow)

Animating UIVisualEffectView Blur Radius?

As the title says it, is there a way to animate a UIVisualEffectView's blur radius? I have a dynamic background behind the view so the ImageEffects addition can't be used... The only thing that can do this as far as I know is to animate the opacity but iOS complains saying that doing that breaks the EffectView so it definitely seems like a bad idea... Any help would be gladly appreciated.


Source: (StackOverflow)

Radius server on Google App Engine?

Is it possible to use Google App Engine as a Radius server?


Source: (StackOverflow)

Can a Radius Server be configured to accept any username/password combination?

I'm doing research for a class at school involving WiFi security. We are setting up a wireless network which uses WPA2 Enterprise authentication. I was wondering if it is possible to have a Radius server accept any username/password combination. Also if this is possible, do you have any suggestions about which open-source Radius server implementations I should check out to accomplish this goal. Any help would be appreciated.


Source: (StackOverflow)

EAP-SIM with JRadius

I am trying to implement a radius client which authenticates via EAP-SIM. The radius client is using the JRadius framework (a requirement of the guys I'm working with), however it seems that JRadius doesn't have an authenticator for EAP-SIM.

Does anybody have any advice on how I might implement it myself (anybody with knowledge of JRadius?) or are there any suggestions for alternative implementations?

Many thanks, Ed.


Source: (StackOverflow)

Test the color of patches in a radius

I hope that you will can help me.

I try to test if one patch in radius 100 is yellow, but it's seem doesn't work. Indeed, the condition seems to be always false, though it's not the case...

ifelse ([pcolor] of patches in-radius 100 = yellow)
[do something]
[do something else]

What is the solution? Thank you.


Source: (StackOverflow)