<b>Linux Journal:</b> "After a recent O/S version upgrade (to openSUSE 11.2) I noticed that bash started being a bit more intelligent when I did something stupid: it started giving me a useful error message..."
Is it possible to create a terminal application which uses cocos2d? I've tried to make one using cocos2d 2.x, but it requires a MacGLView to be initialized.
I need it so that I could program a terminal application that generates a screenshot given a TMX file and an optional preferred width or height parameter (for resizing). Then I can automate the generation of map previews for my game, instead of manually taking screenshots. It's not practical to load the actual TMX and resize it inside the game (what I'm currently doing), because each TMX file has 7 layers, my tile sheet is huge, and I have lots of levels.
I have kind of an odd problem. The time in my Unity bar is right, but the time in bash is 2 hours ahead.
$ date
Wed Jun 20 15:31:55 CDT 2012
Unity bar:
Wed Jun 20 13:31:55
Here are my etc configs:
$ cat /etc/timezone
America/Los_Angeles
locale:
$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Finally, I tried $ sudo dpkg-reconfigure tzdata and setting it to "Los_Angeles".
Has anyone seen anything like this?
tl;dr: How does the ubuntu user on the AWS images for Ubuntu Server 12.04 have passwordless sudo for all commands when there is no configuration for it in `/etc/sudoers'?
I'm using Ubuntu server 12.04 on Amazon. I want to add a new user that has the same behaviour as the default ubuntu user. Specifically I want passwordless sudo for this new user.
So I've added a new user and went to edit /etc/sudoers (using visudo of course). From reading that file it seemed like the default ubuntu user was getting it's passwordless sudo from being a member of the admin group. So I added my new user to that. Which didn't work. Then I tried adding the NOPASSWD directive to sudoers. Which also didn't work.
Anyway, now I'm just curious. How does the ubuntu user get passwordless privileges if they aren't defined in /etc/sudoers. What is the mechanism that allows this?
I have a Bind DNS server that is the local production DNS server and a Windows 2008 R2 domain controller which provides DNS for a lab environment with the domain xyz.lab. I've configured the Bind DNS to forward DNS requests for the domain xyz.lab to the Windows DNS server with this config:
zone "xyz.lab" {
type forward;
forward only;
forwarders { x.x.x.x; };
};
zone "x.x.x.in-addr.arpa" {
type forward;
forward only;
forwarders { x.x.x.x; };
};
And Bind options are (the all_internal acl includes the subnets of both the production and lab networks as well as the loopback of the bind server):
allow-query { all_internal; };
allow-recursion { all_internal; };
allow-transfer { none; };
notify no;
minimal-responses yes;
version "unknown";
Unfortunately, when I do an nslookup or dig on the bind server for a host on the lab domain, the request times out. The logs on the Windows 2008 DNS server show it receiving the query and responding to it and a network packet trace shows the query responses arriving at the Bind DNS server.
The servers reside on the same switch with a router providing connectivity between the layer 3 subnets (production and lab are on different subnets) and there is a round trip time of between 3ms and 5ms on pings between the two servers, so I don't think there is an issue with latency causing a timeout of the query.
In summary a query-response arrives back at the Bind server and the nslookup/dig times-out. Why does the Bind DNS not seem to be doing anything with the query responses when it receives them?
<b>The Geek Stuff:</b> "In this article, let us review various tar examples including how to create tar archives (with gzip and bzip compression), extract a single file or directory, view tar archive contents, validate the integrity of tar archives, finding out the difference between tar archive and file system, estimate the size of the tar archives before creating it"
I have XAMPP installed and my PHP is:
/opt/lampp/bin/php-5.3.8
Every time I need to execute a PHP file I need to do this:
/opt/lampp/bin/php-5.3.8 testando.php
Is there another way to execute it besides using symbolic link?
I did this on /etc/init.d/:
sudo ln -s /opt/lampp/bin/php-5.3.8 php
Why when I need to run PHP I have to do this ./php instead of just php?
And is there a way to do this without the ./? Like it was installed via apt-get?
I'm running 10.04LTS inside VMWare Fusion on a Mac.
The [command] key (aka [windows] on many keyboards) is almost always behaving as if it was [ctrl], even though I done anything explicit to request that behavior.
In fact, in SystemPreferencesKeyboardLayoutsOptionsAlt/Win key behavior, 'default' is chosen (rather than the 'Control is mapped to Win keys' option). However, choosing other options there do not seem to change the handling of [command], at least not as tested in the SystemPreferenceKeyboard Shortcuts app. (No matter what I've tried, [command]-x is always detected as [Ctrl]-x in that app.)
I've tried:
various options under SystemPreferencesKeyboardLayoutsOptionsAlt/Win key behavior
toggling the VMWare Fusion Preferences KKeyboard & Mouse Key Mappings setup which claims to map '[command]' to '[windows]', and restarting the VM in each position
the xmodmap lines suggested at https://help.ubuntu.com/community/MappingWindowsKey
And yet, it's clear that all Ubuntu apps aren't merging [ctrl] and [command], because in 'Terminal', [shift]-[ctrl]-c will Copy, but [shift]-[command]-c will not.
If the [command]/[windows] key was recognized as anything else ('Super', 'Meta', 'Hyper'? I don't care as long as it's not 'Control'), then I could achieve my real goal (which happens to be enabling CMD-based cut/copy/paste in PyCharm, while leaving CTRL-X/etc available for emacs-like bindings). I think any solution which manages to make [command]-x appear as something other than [ctrl]-x in PreferencesKeyboard Shortcuts will probably do the trick.
I am getting an error while executing a remote PowerShell script. From my local machine I am running a PowerShell script that uses Invoke-Command to cd into a directory on a remote Amazon Windows Server instance, and a subsequent Invoke-Command to execute script that lives on that server instance. The script on the server is trying to git clone a repository from GitHub. I can successfully do things in the server script like "ls" or even "git --version". However git clone, git pull, etc. result in the following error:
Cloning into 'MyRepo'... + CategoryInfo : NotSpecified: (Cloning into 'MyRepo'...:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
This is my first time using PowerShell or a Windows Server. Can anyone provide some direction on this problem.
The client script:
$s = new-pssession -computername $server -credential $user
invoke-command -session $s -scriptblock { cd C:\Repos; ls }
invoke-command -session $s -scriptblock { param ($repo, $branch) & '.\clone.ps1' -repository $repo -branch $branch} -ArgumentList $repository, $branch
exit-pssession
The server script:
param([string]$repository = "repository", [string]$branch = "branch")
git --version
start-process -FilePath git -ArgumentList ("clone", "-b $branch https://github.com/MyGithub/$repository.git") -Wait
I've changed the server script to use start process and it is no longer throwing the exception. It creates the new repository directory and the .git directory but doesn't write any of the files from the github repository. This smells like a permissions issue. Once again invoking the script manually (remote desktop into the amazon box and execute it from powershell) works like a charm.
I am using following query which works fine for me except one problem
SELECT f.period as month, sum(p.revenue * ((100-q.rate)/100)) as revenue ,count(distinct q.label) as tot_stmt FROM files f, reports p, rates q,albums a
where f.period in ('2010-06-01','2010-05-01','2010-04-01','2010-03-01')
and f.period_closed = true
and q.period = f.period
and a.id = q.album_id
and p.file_id = f.id
and p.upc = a.upc
and p.revenue is not null
GROUP BY month ORDER BY month DESC
O/P =
month revenue tot_stmt
2010-06-01 10.00 2
2010-05-01 340.47 2
I want result like following
month revenue tot_stmt
2010-06-01 10.00 2
2010-05-01 340.47 2
2010-04-01 0.00 0
2010-03-01 0.00 0
Regards,
Salil Gaikwad
StringBuilder query = new StringBuilder();
query.Append("CREATE TABLE #Codes (Code nvarchar(100) collate database_default ) ");
query.Append("Insert into #Codes (Code) ");
int lengthOfCodesArray = targetCodes.Length;
for (int index = 0; index < lengthOfCodesArray; index++)
{
string targetCode = targetCodes[index];
query.Append("Select N'" + targetCode + "' ");
if (index != lengthOfCodesArray - 1)
{
query.Append("Union All ");
}
}
query.Append("drop table #Codes ");
on: cmd.ExecuteReader() I get
There is insufficient system memory to run this query when creating temporary table
But weird thing is that, when I have 25k codes is ok, when 5k I get this error.
Initial size is 262 MB.
Lengt of each code is average 15.
In bash, when I go back in history, edit some command and run it, this edited command is appended to history and the original one is left intact. But every once in a while I somehow manage to affect the original command, i.e. my edit replaces the original command back in history. I can't put my finger on how this happens. Can someone explain? My goal is to avoid this, so any edit to a previous command always gets appended to history and never replaces the original.
Hi every1,
I'm using NOT IN inside my SQL query.
For example:
select columnA
from table1
where columnA not in (
select columnB
from table2)
How is it possible that this part of the query
select columnB
from table2
takes 30sec to complete, but the whole query above takes 0.1sec to complete??
Shouldn't the complete query take 30sec + ?
BTW, both queries return valid results.
Thanks!
Answers to Comments
Is it because the second query hasn't
actually completed but has only
returned back the first 'x' rows (out
of a very large table?)
No, the query is completed after 30 seconds, not to many rows returned (eg. 50).
But @Aleksandar wondered why the
question congaing the performance
killer was so fast.
my point exactly
Also how long does select distinct
columnB from table2 take to execute?
actually, the original query is "select distinct...
I'm building a windows mobile app. And using SqlCe.
I'm looking for a good sql query builder. So instead of writing "SELECT COLUMNS FROM TABLE WHERE etc...
Is there a good free library that can build this sort of query?
EDIT:
You know when you write your code with ADO.net something like this
SqlCeCommand command = new SqlCeCommand(Connection);
command.CommandText = "SELECT * FROM Orders WHERE customerId = @customerId";
Well i'm looking for some library that could build that SELECT statement using classes instead of writing it through string. So something like:
SqlCeCommand command = new SqlCeCommand(Connection);
SqlQueryBuilder query = new SqlQueryBuilder();
query.Table = "Orders";
query.AddWhere("customerId", myValue)
command.CommandText = query.toString();
Something like that .... so a class that will build the query..
Hi all,
How to use the codeigniter with $this-db-query() method?
If i use active record class i would do like this:
$query = $this->db->get('tb_cash_transaction',$num,$offset);
$this->db->order_by("CURRENCY_ID", "asc");
Now i am using the $this-db-query()
$query = "SELECT * FROM tb_cash_transaction, tb_currency, tb_user where tb_cash_transaction.CURRENCY_ID=tb_currency.CURRENCY_ID and tb_cash_transaction.USER_ID=tb_user.USER_ID and TYPE='cash_out'";
$query = $this->db->query($query);
How to implement it? Thank you.
I would like to translate this query in LINQ ... it is very easy to construct if we do it in pure SQL but in dynamically created LINQ query (building a search query based on user input) it's a whole new story.
SELECT * FROM MyTable
WHERE 1=1
AND Column2 IN (1,2,3)
AND ( Column1 LIKE '%a%' OR Column1 LIKE '%b%' )
Now to try to construct this we tried it this way :
if(myOjb.Column2Collection != null)
query = query.where(f => f.Column2.Contains(myOjb.Column2Collection));
if(myObj.Column1Collection != null)
{
// tough part here ?
//query = query.Where(); ...
}
So what would be the best aproach to this normally ?
Note that I am aware of the SqlMethod.Like, tho I can't figure a way to implement it here ...
I had an idea of using my Windows VM (on a Ubuntu host) to open itms:// links (for iTunes) from the host. So, I'm using vboxmanage guestcontrol to make this happen.
I have a script (win_vm_launcher.sh) that takes a link as the argument, and passes it to the host like this:
vboxmanage guestcontrol "$VM" exec --image 'C:\Windows\System32\cmd.exe' --username "$USER" --password "$PASSWORD" -- /c start "$@"
This works if I copy a link from my browser, and change http to itms. E.g., for https://itunes.apple.com/us/album/new-york-city/id3202598, I can do win_vm_launcher.sh itmss://itunes.apple.com/us/album/new-york-city/id3202598 and it works fine. The album opens up in iTunes on my VM.
However, when I click a "View in iTunes" link from the iTunes site, it adds an extra parameter to the URI (specifically, the referrer), so it looks something like itmss://itunes.apple.com/us/album/new-york-city/id3202598?ign-msr=https%3A%2F%2Fitunes.apple.com%2Fus%2Falbum%2Fit-came-upon-midnight-clear%2Fid578946739
Unfortunately, if I try to run win_vm_launcher.sh itmss://itunes.apple.com/us/album/new-york-city/id3202598?ign-msr=https%3A%2F%2Fitunes.apple.com%2Fus%2Falbum%2Fit-came-upon-midnight-clear%2Fid578946739 it insteads opens up a regular Command Prompt window with the title "itmss://itunes.apple.com/us/album/new-york-city/id3202598?ign-msr=https%3A%2F%2Fitunes.apple.com%2Fus%2Falbum%2Fit-came-upon-midnight-clear%2Fid578946739". I don't even know how to set the command prompt window title, so I'm not sure how that's happening.
If I run the command in the guest, it works fine, opening the album in iTunes:
cmd /c start itmss://itunes.apple.com/us/album/new-york-city/id3202598?ign-msr=https%3A%2F%2Fitunes.apple.com%2Fus%2Falbum%2Fit-came-upon-midnight-clear%2Fid578946739
I found a VirtualBox bug that seems somewhat related, but not exactly.
It probably doesn't matter, but my host is Ubuntu 12.04, and my guest is Windows 7.
So, any idea if vboxmanage is incorrectly passing the arguments, and if so, is there a way around it?
If I can't figure out the right way to do it, I'll end up having to process each argument, and stripping out any parameters on any URIs.
P.S.
I tried creating a batch script (out.bat) like this:
echo %1 > %TEMP%/testing.txt
and then running it from the host like this: vboxmanage guestcontrol "$VM" exec --image 'C:\Windows\System32\cmd.exe' --username "$USER" --password "$PASSWORD" -- /c "C:\path\to\out.bat" "itmss://itunes.apple.com/us/album/new-york-city/id3202598?ign-msr=https%3A%2F%2Fitunes.apple.com%2Fus%2Falbum%2Fit-came-upon-midnight-clear%2Fid578946739"
It ran as expected, and when I open %TEMP%/testing.txt, it contained:
"itmss://itunes.apple.com/us/album/new-york-city/id3202598?ign-msr=https%3A%2F%2Fitunes.apple.com%2Fus%2Falbum%2Fit-came-upon-midnight-clear%2Fid578946739"
including the quotes. So, it sort of passed the parameter correctly (not sure why it still had quotes), so maybe the problem is with cmd.exe, or even the start command. I'm stymied.
I have some command-line commands to execute on a Windows machine. The programs I need to run are only available on Windows.
Is there a way to easily to do something like I would do with SSH? Example of what I mean:
ssh [email protected] "remote command to execute"
...or do I have to Remote Desktop just to do this? (I'd like to run the commands programmatically from another computer rather than running them by hand.)
How can I specify multiple startup tasks in Conemu? I want to have each task in a separate tab opened on startup.
Something like:
ConEmu64.exe /cmdlist {Powershell}|{FAR}|{VSConsole}
Unfortunately, this command does not support "console scripts" ("Console script are not supported here").
I know, I can create another task, combining the commands of my desired tasks (full commands, because task command does not support console scripts). Is there any other way ?
Please share your favorite mc tips here.
My favorites:
I just learned that Alt+. enables easily to toggle display of hidden files (on mc 4.7).
Ctrl+\ - favorite dirs
Alt+s - quick search
BTW:
how to use command line completion without switching to Ctrl+o mode? (TAB does not work, since it changes panels)
how to insert full path of the current panel into the command line?
I'm trying to show the number of lines, words and characters of all configuration files in /etc/*conf (with command wc).
How can I modify the command (or commandline) to not view the error messages?
From a Windows XP command line, how do I get the time I logged into and/or out of the current machine? I'm looking for something like the UNIX last command which lists active and previous login sessions.
Thanks,
John
I would like to extract a "book cover image" from a series of CHM files, which command line tool can do that, please?
I have looked at the source of the QuickLook plug-in "quickchm1.1_source" and at the calibre command line conversion options (ebook-convert) but couldn't find anything akin to simple:
name_of_tool file_to_convert output_image
as in:
mytool routermanual.chm routermanualcoverimage.png
I know that the copy command has an option to automatically replace a file if it already exists, but I want to know if it is a way to copy the files only if they not already exist (/Y). I do not know the actual file names in the batch code, as I copy from the source using wildcards in the copy command:
copy *.zip c:\destination
The reason I want this instead of automatic overwrite is that the files are large, and to skip existing would save a lot of execution time.