Following in the spirit of Hidden Features of Powershell and various others on StackOverflow, what Linux commands or combinations of commands do you find essential in your work?
I'm working on getting a separate internet connection to run out and I was looking into available options. FiOS claims to offer 25Mb up / 25 Mb down as a maximum rate. Do they have listed minimum rates? Is there anything with fiber I should be concerned about? Special hardware, special routers, availability concerns?
I use the following commands to sync folders. Each command requires me to type in the password. How can I group these commands to only enter the password once? Thanks.
rsync -ave ssh /opt/lampp/htdocs/new/folder1/ [email protected]:/home/folder1/
rsync -ave ssh /opt/lampp/htdocs/new/folder2/ [email protected]:/home/folder2/
rsync -ave ssh /opt/lampp/htdocs/new/folder3/ [email protected]:/home/folder3/
I'm working on a cents 6.3 box and am trying to log all commands executed from a bash shell and came across pam_tty_audit. I've added the appropriate line to my /etc/pam.d/system-auth file: "session required pam_tty_audit.so enable=*"
The problem is that it does not appear to capture commands unless a user is root. For example, if i ssh in as root it logs everything to the audit log, but if I ssh as a regular user it does not start logging anything until after I have su to root.
Any ideas?
When trying to run find commands in cygwin, I keep getting the error
"FIND: Parameter format not correct"
However, the same commands run on linux. What's going on?
What I need a way to associate a client name or IP address with an open file, so that I can cleanly close the file for maintenance. NET SESSION doesn't show the names of open files and NET FILE doesn't show the client which has the file open. I had hoped that I could cross-reference the data from these two commands, but that doesn't seem doable. Everything else I've see provides the same data as these commands, with no apparent way to determine which client machine has the file open.
I feel shy to ask this question, but if I don't I will never know, so here I am giving it a shot:
I notice most shell commands use "-" for options, but I also noticed some commands do not have it. For example, to archive files in a given direct, the command is:
tar czvf allmyfiles.tar.gz *
However, to extract an archive, the command I learned, is:
tar -zxvf allmyfiles.tar.gz
Looking at both examples above, is there any significance whether to include the hyphen or not?
I'm trying to check if I have the latest OpenSSL, my main concern in the heartbleed bug.
I tried 2 commands:
openssl version
yum info openssl
openssl version output
OpenSSL 1.0.1e-fips 11 Feb 2013
yum info openssl output
Installed Packages
Name : openssl
Arch : x86_64
Version : 1.0.1e
Release : 16.el6_5.14
...
I have a couple of questions:
Why do I get different versions from these 2 commands?
How do I check the heartbleed vulnerability without having the 443 port open?
Let's say I entered a bunch of commands one after another:
rm blah.txt
pwd
ls
cd ..
cd blah
pwd
If I want to get "rm blah.txt" to appear again without typing the whole thing again, I can press up 6 times.
But is there a faster way? Can filter my command history based on some text?
Intuitively, I would like to just type in r and then press up to search through my command history for only commands that started with "r".
Currently i installed ubunot on ubunto 4.4, and using following commands i can see mysql, mysqld running
ps -ef | grep mysql
ps -ef | grep mysqld
but when I run, netstat i don't see mysql and 3306 anywhere. in my.cnf file, i have given my ip and port is 3306.
also when i run this command
sudo netstat -tap | grep mysql
i don't see anything and commands
I needed to run the mysql 5 on port 3306 and on ip=x.x.x.x for remotely accessible
Looking forward to your reply
I use the following commands
pdf2ps input.pdf - | psnup -pA4 -4 >> output.ps
ps2pdf output.ps output.pdf
rm output.ps
to merge multiple pages (in this case 4) from input file to one sheet in outupt file.
How can I modify pipelining so that I won't have to use 2 commands, but just a single one liner? Is there any other commandline tool that would do the same and can work directly on pdf files?
I have a WPF application with the following KeyBinding on its main window:
<KeyBinding Command="Commands:EditCommands.Undo" Gesture="CTRL+Z" />
<KeyBinding Command="Commands:EditCommands.Redo" Gesture="CTRL+Y" />
This makes the command respond to the shortcut fine. However, in all the places where I have embedded WinForms text boxes or rich text boxes, I've lost the ability to use those shortcuts. If I remove the above bindings, the WinForms shortcuts work fine.
How can I support these shortcuts in both WinForms and WPF? I'd prefer a generic method since this problem is likely to affect many other commands with the same keybindings.
I found the console and run it like this:
root@valugi-laptop:/var/www/sandbox/hello# php console
Symfony version 2.0.0-DEV - hello
Usage:
Symfony [options] command [arguments]
Options:
--help -h Display this help message.
--quiet -q Do not output any message.
--verbose -v Increase verbosity of messages.
--version -V Display this program version.
--color -c Force ANSI color output.
--no-interaction -n Do not ask any interactive question.
--shell -s Launch the shell.
Available commands:
help Displays help for a command (?)
list Lists commands
assets
:install
bundle
:pharize
container
:graphviz
doctrine
:generate-proxies
init
:application
:bundle
router
:debug Displays current routes for an application
:dump-apache
But I cannot run any of those commands. I am trying like this:
php console Symfony -h
But I get
[InvalidArgumentException]
Command "Symfony" is not defined.
Any suggestions?
While working on iphone security architecture, i came to know that i can run applications from other applications in iphone. referring to the following url http://iphonedevelopertips.com/cocoa/launching-other-apps-within-an-iphone-application.html
for example, i can put a link in a website with following hyperlink
skype://
will result skype to run and call at particular number. Now i have few concerns here.
is there a shell running in background in iphone, so that it allows other application to run basic app commands.
if the above statement is true then how can i enable or run commands directly into iphone shell?
if above statements are false, then could you please explain how these commands are being executed?
is this part of iPhone SDK? or this funcationality is iPhone OS
While working on iphone security architecture, i came to know that i can run applications from other applications in iphone. referring to the following url http://iphonedevelopertips.com/cocoa/launching-other-apps-within-an-iphone-application.html
for example, i can put a link in a website with following hyperlink
skype://
will result skype to run and call at particular number. Now i have few concerns here.
is there a shell running in background in iphone, so that it allows other application to run basic app commands.
if the above statement is true then how can i enable or run commands directly into iphone shell?
if above statements are false, then could you please explain how these commands are being executed?
is this part of iPhone SDK? or this funcationality is iPhone OS
Hi all,
I have a personal project I'm planning and I came to a small hurdle.
I want to have an item with price that will be the default for all clients/users. However, in my business I have some clients that are grandfathered in to some special pricing. In the case of these grandfathered in cases, I'll manually plug their special price in my admin section. Then all they will see is their special pricing while the regular users/clients see the default price.
What is the best and simplest way to design the back-end for this?
FYI - I'll be using rails as my framework.
Many thanks!
-Tony
Hi all,
I have a personal project I'm planning and I came to a small hurdle.
I want to have an item with price that will be the default for all clients/users. However, in my business I have some clients that are grandfathered in to some special pricing. In the case of these grandfathered in cases, I'll manually plug their special price in my admin section. Then all they will see is their special pricing while the regular users/clients see the default price.
What is the best and simplest way to design the back-end for this?
FYI - I'll be using rails as my framework.
Many thanks!
-Tony
Hi!
I can't seem to find a way to reference the value in a column in the grid, in my case it is the StatusId. Based on the cell value in this row, for the StatusId, I need to return a true or false to the method ".Visible(???)". It would be nice to find the answer in the documentation online but I haven't been able to. I find it hard to believe that I would be the first person who ever needed this functionality.
I would be most appreciative of any assistance since no one in the telerik forums know.
.Columns(columns => {
columns.Command(commands => {
commands.Edit().ButtonType(ButtonType);
commands.Delete().ButtonType(ButtonType);
}).Width(90).Visible(???);
Thanks!
AZee
I'm building a simple interpreter in python and I'm having trouble handling differing numbers of arguments to my functions. My current method is to get a list of the commands/arguments as follows.
args = str(raw_input('>> ')).split()
com = args.pop(0)
Then to execute com, I check to see if it is in my dictionary of command- code mappings and if it is I call the function I have stored there. For a command with no arguments, this would look like:
commands[com]()
However, if a command had multiple arguments, I would want this:
commands[com](args[0],args[1])
Is there some trick where I could pass some (or all) of the elements of my arg list to the function that I'm trying to call? Or is there a better way of implementing this without having to use python's cmd class?
Hi guys!
I'm trying to create permalink like behavior for some article titles and i don't want to add a new db field for permalink. So i decided to write a helper that will convert my article title from:
"O "focoasa" a pornit cruciada, împotriva barbatilor zgârciti" to
"o-focoasa-a-pornit-cruciada-impotriva-barbatilor-zgarciti".
While i figured out how to replace spaces with hyphens and remove other special characters (other than -) using:
title.gsub(/\s/, "-").gsub(/[^\w-]/, '').downcase
I am wondering if there is any other way to replace a character with a specific other character from only one .gsub method call, so I won't have to chain title.gsub("a", "a") methods for all the UTF-8 special characters of my localization.
I was thinking of building a hash with all the special characters and their counterparts but I haven't figured out yet how to use variables with regexps.
What I was looking for is something like:
title.gsub(/\s/, "-").gsub(*replace character goes here*).gsub(/[^\w-]/, '').downcase
Thanks!
I am trying to implement a linux shell that supports piping. I have already done simple commands, commands running in background, redirections, but piping is still missing.
I have already read about it and seen some snippets of code, but still haven't been able to sort out a working solution.
What I have so far:
int fd[2];
pid_t pid = fork();
if (pid == -1)
return -1;
if (pid == 0)
{
dup2(0, fd[0]);
execlp("sort", "sort", NULL);
}
I am a novice programmer, as you can probably tell, and when I am programming something I don't know much about, this being obviously the case, I like to start with something really easy and concrete and then build from there.
So, before being able to implement three and more different commands in pipeline, I would like to be able to compute "ls names.txt | sort" or something similiar, in which names.txt is a file of names alfabetically unordered.
Thanks.
Maybe I am asking the wrong questions, because I don't see any sample projects out there. I know Flash developers have done Kiosks and renovated arcade games. "Come on, we see Flash everywhere." Is there a sample project I could be pointed towards, it would be an ass-saver.
Can I prepare my swf files like an image gallery and receive XML commands to load it? Where do I start? Flash/After Effects skills have got me through so far, but I need help!!! It would be fun if it wasn't so stressful.
Criteria
TCP/IP socket connection
Flash package
XML commands load swf file in to a container
Additional Questions
How do I prepare my Flash files and XML sheet to receive commands "any sample out there"?
What about e.data, urlLoad, xmlSocket Class, XMLCP/IP XML socket connection to load
Is binary or XML method better for loading and reloading swf files?
Do I need Red5 or a media server?
videoDnd,
Ambitious Development Noob
Hi,
I need to print a receipt from my web based apps using dot matrix printer epson tm-u220d (pos printer).
I need to know, should I generate the receipt in html or in plain text ?
I ever saw some commands for dot matrix printer to change the font size, line feed etc .. but I don't remember that commands. if I have to use plain text I need to use that commands. anyone knows where i can get the references ?
Thanks
Hi,
I'm trying to make some "social share" buttons at my site, but the urls I generate just don't get decoded by this services.
One example, for twitter:
private function twitter(e:Event):void {
var message:String = "Message with special chars âõáà";
var url:String = "http://www.twitter.com/home?status=";
var link:URLRequest = new URLRequest( url + escape(message) );
}
But when twitter opens up, the message is:
Message with special chars
%E2%F5%E1%E0
Something similar is happening with Facebook and Orkut (but these two hide the special chars).
Someone know why is this happening?
I have a file to execute in Ksh written by someone. It has a set of commands to execute in sqlplus.
It starts with,
sqlplus -s $UP <<- END
followed by a set of ddl commands such as create,drop,etc.,
When I execute the file in the shell, I get the error in the starting line quoted above.
I understand "-s" starts the sqlplus in silent mode and $UP is the connection string with username/password. But I couldn't make heads or tails of "<<- END" part(Many sites from google says input redirection is "<<" not "<<-"). So I presumed the error must be in that part and removed it from the file.
Now it reads,
sqlplus -s $UP
But once I execute the file, It waits for input from the shell, instead of reading the rest of the lines from the file. How would I make sqlplus to execute the ddl commands in the rest of the file?. Thanks in advance.