What’s the easiest way to get a user’s full name on a Linux/POSIX system?

You don’t specify a programming language, so I’ll assume you want to use the shell; here’s an answer for Posix shells. Two steps to this: get the appropriate record, then get the field you want from that record. First, getting the account record is done by querying the passwd table: $ user_name=foo $ user_record=”$(getent passwd … Read more

Creating and managing a Facebook app from a Business Account [closed]

‘Business’ or advertising accounts can’t manage apps – if at some point in the past you were able to create an app using a business account this was a bug or loophole and shouldn’t have been possible – only real verified user accounts should be able to create and manage apps. It’s also possible to … Read more

How to grant full permission to a file created by my application for ALL users?

Note to people using this. When using literal strings for the FileSystemAccessRule, it should be WellKnownSidType.WorldSid instead of “everyone”. The reason is because there are multiple Window languages and Everyone only applies to EN ones, so for Spanish, it might be “Todos” (or something else). using System.Security.AccessControl; using System.Security.Principal; using System.IO; private void GrantAccess(string fullPath) … Read more

Detect if running as Administrator with or without elevated privileges?

Try this out: using Microsoft.Win32; using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Security.Principal; public static class UacHelper { private const string uacRegistryKey = “Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System”; private const string uacRegistryValue = “EnableLUA”; private static uint STANDARD_RIGHTS_READ = 0x00020000; private static uint TOKEN_QUERY = 0x0008; private static uint TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY); [DllImport(“advapi32.dll”, SetLastError = true)] [return: … Read more

How to create linux account with useradd without creating mail spool

man useradd -K, –key KEY=VALUE Overrides /etc/login.defs defaults (UID_MIN, UID_MAX, UMASK, PASS_MAX_DAYS and others). Example: -K PASS_MAX_DAYS=-1 can be used when creating system account to turn off password ageing, even though system account has no password at all. Multiple -K options can be specified, e.g.: -K UID_MIN=100 -K UID_MAX=499 So, try this: # useradd -K … Read more