Jump to content

Jason Cooper

Dedicated Members
  • Posts

  • Joined

  • Last visited

  • Days Won


Profile Information

  • Gender
  • Location
    Great Britain
  • Interests
    Lock Picking,
    And many more

Recent Profile Visitors

8,332 profile views

Jason Cooper's Achievements


Newbie (1/14)

  1. Does the access point broadcast SSID Beacons? If so then you could put together a simple setup with something like a Raspberry Pi that continually sniffs the SSID Beacons it can see and if it doesn't see the one you're monitoring within the last X seconds it sends an alert.
  2. Have you checked your SELinux logs to make sure that isn't the cause of your problem?
  3. Have you tried the Export-Csv cmdlet? You'll need to squeeze your variables in to an object though. "" | select-object @{Name="Column 1"; Expression={"$variable1"}},@{Name="Column 2"; Expression={"$variable2"}}, @{Name="Column 3"; Expression={"$variable3"}} | Export-Csv -Path "test.csv" -notypeinformation -Encoding UTF8 -Append
  4. Here's how I'd tackle it. The key part is not to break it down to 40 character lines, but instead to take 40 character length sub-strings from the sequence, where each sub-string starts 37 characters on from the start of the previous sub-string. #!/usr/bin/perl my $sequence = "1234567890123456789012345678901234567890123456789012345678901234567890"; my $length = length $sequence; for ( my $i = 0; $i < $length; $i += 37 ) { print substr($sequence, $i, 40) . "\n"; }
  5. For simple deduplication of arrays you can use an associative array/hash. Simply use the word as the key and give it a value of true. Enumerating the keys then gives you the deduplicated list of words. If you want that list sorted then simply sort it afterwards. Here's a quick Perl example: #!/usr/bin/perl use strict; use warnings; my %words; while (my $line = <STDIN>) { chomp($line); $words{lc($line)} = 1; } print join("\n", sort keys %words);
  6. Have you tried a here-string? $testing = "blabla" @" Testing 1 Testing 2 $testing Testing 3 "@ | clip
  7. At the risk of showing my age, the first OS I started on was Tangerine BASIC, on the old Oric Atmos. I'd used CP/M before that but the Oric was where I started to learn how to make the computer do what I wanted, rather than what someone else had told it to do.
  8. That looks very odd to me, as when I try it in powershell it works fine. PS > $folderPath="\\server\folder1\folder2\~folder3" PS > $splitFolder = $folderPath -split '\\' PS > echo $splitFolder[2] server PS > echo $splitFolder[3] folder1 PS > echo $splitFolder[4] folder2 PS > echo $splitFolder[5] ~folder3 In fact if I ask for an array index that doesn't exist I still don't get the error PS > echo $splitFolder[6] PS > I can get the same error you get by misspelling the variable name (e.g. by dropping the 'e' in folder) PS > echo $splitFoldr[6] Cannot index into a null array. At line:1 char:1 + echo $splitFoldr[6] + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray I'd suggest check the spelling (though I can't see any difference in your example) and trying again.
  9. Have you tried using something like: grep -orEH "(sub|new)" * | sed -re's|^([^:]*):(.*)$|\2:\1|' | sort The sed part switches the file name and matched keyword round so that the sort can then sort the output into keyword order. If you don't want duplicates to appear then simply pipe the output through uniq (if you supply uniq with the -c option then it'll give you count of how many times that keyword appears in that file).
  10. Could well be a distro thing, I've tried it in a CentOS 6 based distro and a debian wheezy based distro, and both use HWaddr.
  11. If you know your device's MAC address you can use something like ifconfig | grep "HWaddr XX:XX:XX:XX:XX:XX" | cut -d' ' -f1 Just remember to replace the XX:XX:XX... with your device's MAC address
  12. You probably want to add an input element to your form so that the user can can enter a username of the person they want to make the friend request with, then you'll have a username you can use to look up a user_id from your registeredusers table. Also, while Xorifelse's comment on stack overflow could have been worded better, it is definitely worth learning about parameterized queries (better to learn good habits to start with than have to unlearn bad ones later).
  13. A quick description of what your social network does (or what you want it to do) would be helpful, otherwise we'll just be making broad statements that may or may not be useful, or even correct in the context of your social network. For example, a social network where people join groups and post messages to those groups would require different design to one where users choose to follow others and see everything those others post. Also the underlying technology would be useful to know, e.g. does your PHP use a relational database, a NoSQL database, flat files, etc?
  14. Actually it does explain why it worked, but I'll go into it in a bit more depth. When using the $Group in double quotes it stringifys the value of the object so we have four strings @{Name=@Testone} @{Name=@Testtwo} @{Name=Testthree} @{Name=Testfour} The regular expression the OP provided as a solution is looking for an @ symbol followed by a character that is in the range or a - z, A - Z or 0 - 9. While all four strings start with an @ symbol those are immediately followed by an open brace '{' which doesn't match the pattern that the regular expression is looking for. The first and second strings have another @ symbol which does match the pattern as they're followed by the letter 'T' which is in the range being matched. The OP's solution however doesn't actually meet the criteria of only matching groups starting with an @ symbol as any groups that contain an @ symbol in the middle of their name (e.g. Test@five) as it will be matched by the "`@[a-zA-Z0-0]" regular expression as well.
  15. Seeing your output suddenly makes it all make sense. The $group variable isn't a simple string, it's actually an object with a Name property. When you put it in double quotes Powershell produces a stringified version of the object, which starts with the @ symbol (e.g. "@{Name=@Testone}". You then do a regular expression match against that string, which sees the first character as the @ symbol, which is matches what it's looking for exactly. I don't have access to an active directory to test, but try matching against the $group object's Name propery instead, e.g. $y = Get-ADuser JOEBLOGGS -property MemberOf | % {$_.MemberOf | Get-ADGroup | select Name | sort name} foreach ($group in $y) { if ($group.Name -match "^@") { echo "yep $group" } else { echo "Nope $group" } }
  • Create New...